JQuery外掛程式之圖片輪播外掛程式–slideBox

來源:互聯網
上載者:User

標籤:des   style   http   color   io   os   ar   java   檔案   

來源:http://www.ido321.com/852.html

 

今天偶然發現了一個比較好用的圖片輪播外掛程式—slideBox

先看看效果:http://slidebox.sinaapp.com/

代碼如下

   1: <!doctype html>
   2: <html>
   3: <head>
   4: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   5: <title>slideBox輪播外掛程式</title>
   6: <link href="css/jquery.slideBox.css" rel="stylesheet" type="text/css" />
   7: </head>
   8: <body>
   9: <center>
  10: <h5>一、左右輪播,滾動持續0.6秒,滾動延遲3秒,滾動效果swing,初始焦點第1張,點選按鍵自動隱藏,按鍵邊框半徑(IE8-只方不圓)5px(以上各項為預設設定值)</h3>
  11: <div id="demo1" class="slideBox">
  12:   <ul class="items">
  13:     <li><a href="http://www.ido321.com" title="標題一"><img src="./img/1.jpg"></a></li>
  14:     <li><a href="http://www.ido321.com" title="標題二"><img src="./img/0.jpeg"></a></li>
  15:     <li><a href="http://www.ido321.com" title="標題三"><img src="./img/2.png"></a></li>
  16:   </ul>
  17: </div>
  18: <h5>二、上下輪播,滾動持續0.3秒,滾動延遲5秒,滾動效果linear,初始焦點第2張,點選按鍵自動隱藏</h3>
  19: <div id="demo2" class="slideBox">
  20:   <ul class="items">
  21:    <li><a href="http://www.ido321.com" title="標題一"><img src="./img/1.jpg"></a></li>
  22:     <li><a href="http://www.ido321.com" title="標題二"><img src="./img/0.jpeg"></a></li>
  23:     <li><a href="http://www.ido321.com" title="標題三"><img src="./img/2.png"></a></li>
  24:   </ul>
  25: </div></center>
  26: <script src="js/jquery.min.js" type="text/javascript"></script>
  27: <script src="js/jquery.slideBox.min.js" type="text/javascript"></script>
  28: <script>
  29: jQuery(function($){
  30:     $(‘#demo1‘).slideBox();
  31:     $(‘#demo2‘).slideBox({
  32:         direction : ‘top‘,//left,top#方向
  33:         duration : 0.3,//滾動期間,單位:秒
  34:         easing : ‘linear‘,//swing,linear//滾動特效
  35:         delay : 5,//滾動延遲時間,單位:秒
  36:         startIndex : 1//初始焦點順序
  37:     });
  38: });
  39: </script>
  40: <div style="text-align:center;clear:both">
  41: <p>適用瀏覽器:IE8、360、FireFox、Chrome等瀏覽器</p>
  42: <p>來源:<a href="http://www.ido321.com/" target="_blank">淡忘~淺思</a></p>
  43: </div>
  44: </body>
  45: </html>

在代碼中引入了slideBox.css和slideBox.js檔案。demo1用的是預設的設定,demo2是自訂設定。

slide的預設設定如下

   1: //預設參數
   2:       var defaults = {
   3:           direction : ‘left‘,//left,top
   4:           duration : 0.6,//unit:seconds
   5:           easing : ‘swing‘,//swing,linear
   6:           delay : 3,//unit:seconds
   7:           startIndex : 0,
   8:           hideClickBar : true,
   9:           clickBarRadius : 5,//unit:px
  10:           hideBottomBar : false,
  11:           width : null,
  12:           height : null
  13:       };

JQuery外掛程式之圖片輪播外掛程式–slideBox

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.