jQuery plugin : bgStretcher 背景图片切换效果插件
转自:http://blog.dvxj.com/pandola/jQuery_bgStretcher.html
bgStretcher 2011 (Background Stretcher)是一个jQuery的插件,可以为你的网页添加多张背景图,且多个背景图能够自动切换,同时背景图大小可以自适应浏览器窗口的大小。背景图的切换效果有淡入淡出,滚动,幻灯,其中选用滚动和幻灯时,可以选择方向,上下左右,或者左上右下,右上左下。图片切换顺序也可以设置正向,反向或者随机。更多选项就看你自己慢慢研究了。 插件特点:
1 |
< link rel = "stylesheet" type = "text/css" href = "./main.css" /> |
2 |
< link rel = "stylesheet" type = "text/css" href = "../bgstretcher.css" /> |
3 |
< script type = "text/javascript" src = "../jquery-1.5.2.min.js" ></ script > |
4 |
< script type = "text/javascript" src = "../bgstretcher.js" ></ script > |
接着把下面的代码,插入到上面代码之后,来初始化 bgStretcher 插件,要告知插件在哪个元素上起作用,同时可以配置插件的选项。同样,注意代码中的图片路径不要出错。
01 |
< script type = "text/javascript" > |
02 |
$(document).ready(function(){ |
03 |
|
04 |
// Initialize Backgound Stretcher |
05 |
$('.demoo').bgStretcher({ |
06 |
images: ['images/sample-1.jpg', 'images/sample-2.jpg', 'images/sample-3.jpg', 'images/sample-4.jpg', 'images/sample-5.jpg', 'images/sample-6.jpg'], |
07 |
imageWidth: 800, |
08 |
imageHeight: 400, |
09 |
slideDirection: 'N', |
10 |
slideShowSpeed: 1000, |
11 |
transitionEffect: 'fade', |
12 |
sequenceMode: 'normal', |
13 |
}); |
14 |
|
15 |
}); |
16 |
</ script > |
配置选项 | 缺 省 值 | 选项说明 |
---|---|---|
imageContainer | bgstretcher | bgStretcher will automatically build structure for the images list in a DOM tree. This parameter is ID for the images holder. Try inspecting the tree with a FireBug to get an idea how it's constructed. |
resizeProportionally | true | Indicates if background image(s) will be resized proportionally or not. |
resizeAnimate | false | Indicates if background image(s) will be resized with animation. (Be careful, this may slow down some PCs if your images are large.) |
images | empty | An array containing list of images to be displayed on page's background. |
imageWidth | 1024 | Original image's width. |
imageHeight | 768 | Original image's height. |
maxWidth | auto | Maximum image's width. |
maxHeight | auto | Maximum image's height. |
nextSlideDelay | 3000 (3 seconds) | Numeric value in milliseconds. The parameter sets delay until next slide should start. |
slideShowSpeed | normal | Numeric value in milliseconds or jQuery string value ('fast', 'normal', 'slow'). The parameter sets the speed of transition between images. |
slideShow | true | Allows or disallows slideshow functionality. |
transitionEffect | fade | Transition effect (use also: none, simpleSlide, superSlide). |
slideDirection | N | Slide Diraction: N – north, S – south, W – west, E – East (if transitionEffect = superSlide use also: NW, NE, SW, SE). |
sequenceMode | normal | Sequence mode (use also: back, random) |
buttonPrev | empty | Previous button CSS selector |
buttonNext | empty | Next button CSS selector |
pagination | empty | CSS selector for pagination |
anchoring | 'left top' | Anchoring bgStrtcher area regarding window |
anchoringImg | 'left top' | Anchoring images regarding window |
preloadImg | false | For Preload images use true |
stratElementIndex | 0 | Start element index |
callbackfunction | null | Name of callback function |
插件方法:
方法名称 | 方法说明 |
---|---|
$(objID).bgStretcher.play() | Resume background slideshow |
$(objID).bgStretcher.pause() | Pause background slideshow |
$(objID).bgStretcher.sliderDestroy() | Destroy background slideshow |
原文在这里,俺稍微翻译了一下,演示效果俺自己调整了参数。 http://www.ajaxblender.com/bgstretcher-2-jquery-stretch-background-plugin-updated.html
jQuery plugin : bgStretcher 背景图片切换效果插件的更多相关文章
- 10款好用的 jQuery 图片切换效果插件
jQuery 是一个非常优秀的 Javascript 框架,使用简单灵活,同时还有许多成熟的插件可供选择.其中,最令人印象深刻的应用之一就是对图片的处理,它可以让帮助你在你的项目中加入一些让人惊叹的效 ...
- 100种不同图片切换效果插件pageSwitch
分享100种不同图片切换效果插件pageSwitch.这是一款适用于全屏切换场景,即一切一屏,并且实现了超过一百种切换效果,支持自定义切页动画.效果图如下: 在线预览 源码下载 实现的代码. ht ...
- jquery带按钮的图片切换效果
<!doctype html> <html> <head> <meta charset="gb2312"> <title> ...
- jQuery自动与手动图片切换效果下载
效果图: 查看效果:http://hovertree.com/jq/hovertreeimg/ 下载:http://hovertree.com/h/bjaf/gk8mko69.htm 使用代码: &l ...
- 10 款基于 jQuery 的切换效果插件推荐
本文整理了 10 款非常好用的 jQuery 切换效果插件,包括平滑切换和重叠动画等,这些插件可以实现不同元素之间的动态切换. 1. InnerFade 这是一个基于 jQuery 的小插件,可以实现 ...
- 基于jQuery图像碎片切换效果插件FragmentFly
基于jQuery图像碎片切换效果插件FragmentFly.这是一款只需三步轻松完成碎片动画,参数可调,使用方便. 在线预览 源码下载 部分代码: <div class="all_ ...
- jquery简单的图片切换效果,支持pc端、移动端的banner图片切换开发
详细内容请点击 无意中看见了两年前写的一个图片切换,那会儿刚刚学习网页制作,可以说是我的第一个处女座的jquery图片切换效果.无聊之余对它的宽度稍稍做了一下修改,变成了支持pc端.手机端全屏的ban ...
- [Android实例] app引导页(背景图片切换加各个页面动画效果)(申明:来源于网络)
[Android实例] app引导页(背景图片切换加各个页面动画效果)(申明:来源于网络) 地址: http://www.eoeandroid.com/thread-918356-1-1.html h ...
- css3全屏背景图片切换特效
效果体验:http://hovertree.com/texiao/css3/10/ 一般做图片切换效果,都会使用JS或者jQuery脚本,今天发现,其实只用CSS也可以实现.试试效果吧. 效果图: 代 ...
随机推荐
- Mysql 5.7主主复制配置
MySQL5.7主主复制配置 主机1IP:192.168.1.2主机2IP:192.168.1.4 一.首先安装MySQL 5.71.卸载两台主机系统中已经有的mysql相关软件包rpm -qa | ...
- C# 数组之int[]
一.数组分类 数组可以简单分为3类: 1维数组 2维数组 交错数组 二.数组初始化 1.一维数组 int [] A = { 1,2,3,4 } 直接赋值 或者 int [] A = new int [ ...
- HTTP协议初识
HTTP协议介绍 当你在浏览器地址栏敲入“http://www.cnblogs.com/”,然后猛按回车,呈现在你面前的,将是博客园的首页了(这真是废话,你会认为这是理所当然的).作为一个开发者,尤其 ...
- 几款常用的高质量web前端框架
http://blog.csdn.net/qianduankuangjia/article/details/78042944
- 如何减小SQL 的物理读,。
1.dev time:1226 1个跑批 db_file_multiblock_read_count =128 60.05 (mins) 26-Dec-17 16:00:20 ~ 26-Dec-17 ...
- (转)linux mount (挂载命令)详解
linux mount (挂载命令)详解 原文:http://tutu.spaces.eepw.com.cn/articles/article/item/70737 挂接命令(mount) 首先,介绍 ...
- centos6.3搭建FTP服务器图文教程
今天下午不忙,没什么事,看到我大红盟linux版块如此冷清,心不能忍,做了个FTP服务器的搭建教程,大家可以看看, 不会做视频,就图文交叉了,写得不好,望谅解.以后有时间再出一个LNMP的教程. 不磨 ...
- 浅谈C#解析网页
最近做了一个项目,要求获取各大主流网页上的关键信息,本人以前了解过网页爬虫的知识,所以想到了网页爬虫了实现功能 第一次尝试: 采用webclient获取远程网页的内容,然后采用正则表达式进行过滤 但, ...
- nodejs 实践:express 最佳实践(八) egg.js 框架的优缺点
nodejs 实践:express 最佳实践(八) egg.js 框架的优缺点 优点 所有的 web开发的点都考虑到了 agent 很有特色 文件夹规划到位 扩展能力优秀 缺点 最大的问题在于: 使用 ...
- VS2012快捷键消失
我也是网上搜的不过我认为挺有效就自己摘录下来了,具体原作者也找不到,所以就下手了,望原谅. 开始菜单 -->所有程序-->Visual Studio 2012文件夹 --> Visu ...