jquery實現焦點圖片隨機切換效果的方法
更新時間:2015年03月12日 10:14:33 作者:pyawen
這篇文章主要介紹了jquery實現焦點圖片隨機切換效果的方法,涉及jQuery插件jquery.easing.1.3.js的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下
本文實例講述了jquery實現焦點圖片隨機切換效果的方法。分享給大家供大家參考。具體如下:
1. 運行效果如下圖所示:

2.完整實例代碼點擊此處本站下載。
3.完整代碼如下:
復制代碼 代碼如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Slides, A Slideshow Plugin for jQuery</title>
<link rel="stylesheet" href="css/global.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script>
<script src="js/slides.min.jquery.js"></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>
</head>
<body>
<div id="container">
<div id="example">
<img src="img/new-ribbon.png" width="112" height="112" alt="New Ribbon" id="ribbon">
<div id="slides">
<div class="slides_container">
<a title="145.365 - Happy Bokeh Thursday! | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-1.jpg" width="570" height="270" alt="Slide 1"></a>
<a title="Taxi | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-2.jpg" width="570" height="270" alt="Slide 2"></a>
<a title="Happy Bokeh raining Day | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-3.jpg" width="570" height="270" alt="Slide 3"></a>
<a title="We Eat Light | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-4.jpg" width="570" height="270" alt="Slide 4"></a>
<a title="“I must go down to the sea again, to the lonely sea and the sky; and all I ask is a tall ship and a star to steer her by.” | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-5.jpg" width="570" height="270" alt="Slide 5"></a>
<a title="twelve.inch | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-6.jpg" width="570" height="270" alt="Slide 6"></a>
<a title="Save my love for loneliness | Flickr - Photo Sharing!" target="_blank"><img src="http://slidesjs.com/examples/standard/img/slide-7.jpg" width="570" height="270" alt="Slide 7"></a>
</div>
<a href="#" class="prev"><img src="img/arrow-prev.png" width="24" height="43" alt="Arrow Prev"></a>
<a href="#" class="next"><img src="img/arrow-next.png" width="24" height="43" alt="Arrow Next"></a>
</div>
<img src="img/example-frame.png" width="739" height="341" alt="Example Frame" id="frame">
</div>
<div id="footer">
<p>For full instructions go to <a target="_blank">http://slidesjs.com</a>.</p>
<p>Slider design by Orman Clark at <a target="_blank">Premium Pixels</a>. You can donwload the source PSD at <a target="_blank">Premium Pixels</a></p>
<p>© 2010 <a target="_blank">Nathan Searles</a>. All rights reserved. Slides is licensed under the <a target="_blank">Apache license</a>.</p>
</div>
</div>
</body>
</html>
希望本文所述對大家的jQuery程序設計有所幫助。
您可能感興趣的文章:
- jQuery焦點圖切換特效代碼分享
- jQuery滿屏焦點圖左右滾動特效代碼分享
- jQuery橫向擦除焦點圖特效代碼分享
- jquery京東商城雙11焦點圖多圖廣告特效代碼分享
- jQuery右側選項卡焦點圖片輪播特效代碼分享
- jQuery實現仿Alipay支付寶首頁全屏焦點圖切換特效
- jquery實現多屏多圖焦點圖切換特效的方法
- jQuery插件bxSlider實現響應式焦點圖
- jQuery插件Skippr實現焦點圖幻燈片特效
- jQuery插件Elastislide實現響應式的焦點圖無縫滾動切換特效
- jQuery實現左右切換焦點圖
- jQuery+css3動畫屬性制作獵豹瀏覽器寬屏banner焦點圖
- jQuery實現標題有打字效果的焦點圖代碼
相關文章
用jQuery將JavaScript對象轉換為querystring查詢字符串的方法
這篇文章主要介紹了用jQuery將JavaScript對象轉換為querystring查詢字符串的方法,本文給大家分享兩種方法,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下2018-11-11
解析jQuery的三種bind/One/Live事件綁定使用方法
本篇文章主要是對jQuery的三種bind/One/Live事件綁定使用方法進行了介紹,需要的朋友可以過來參考下,希望對大家有所幫助2013-12-12
基于jquery實現可定制的web在線富文本編輯器附源碼下載
UEditor的功能非常強大,官方已配備了php,asp,asp.net,java等語言的上傳程序,拿來就可以使用,當然ueditor更具有功能插件接口,很輕松地添加自己定義功能到編輯器中,方便項目的不同需求2015-11-11

