本文实例讲述了jquery实现焦点图片随机切换效果的方法。分享给大家供大家参考。具体如下:
1. 运行效果如下图所示:

2.完整实例代码点击此处本站下载。
3.完整代码如下:
代码如下:
Slides, A Slideshow Plugin for jQuery
script>
script>
script>
$(function(){
var easings = [];
var row = 0;
for(var x in jQuery.easing){
if (x != 'linear' && x != 'swing') {
easings[row++] = x;
}
}
$('#slides').slides({
preload: true,
preloadImage: 'img/loading.gif',
play: 5000,
pause: 2500,
slideEasing: "swing",
slideSpeed : 2000,
hoverPause: true,
animationComplete: function(current) {
var index = Math.floor(Math.random() * easings.length);
jQuery.easing.def = easings[index];
}
});
});
script>
For full instructions go to http://slidesjs.com.
Slider design by Orman Clark at Premium Pixels. You can donwload the source PSD at Premium Pixels
© 2010 Nathan Searles. All rights reserved. Slides is licensed under the Apache license.
希望本文所述对大家的jQuery程序设计有所帮助。