jQuery外掛程式slicebox實現3D動畫圖片輪播切換特效

來源:互聯網
上載者:User

jQuery外掛程式slicebox實現3D動畫圖片輪播切換特效

 漂亮jQuery 3D動畫圖片輪播切換特效外掛程式jquery.slicebox.js,基於jQuery,外掛程式採用CSS 3D 動畫效果,支援事件Callback調用,支援參數自訂配置,如:speed:600 切換速度、autoplay:true 是否自動播放,在瀏覽器安全色方面,需要瀏覽器支援CSS3變換變形屬性,不支援的將看不到3D特效,推薦學習下代碼。

使用方法:

1.載入外掛程式和jQuery

1

2

3

4

<link type="text/css" rel="stylesheet" href="css/slicebox.css" />

<script type="text/javascript" src="js/modernizr.js"></script>

<script type="text/javascript" src="js/jquery8.js"></script>

<script type="text/javascript" src="js/jquery.slicebox.js"></script>

2.HTML內容,HTML頭部需要採用HTML5頭 <!DOCTYPE html>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

<ul id="sb-slider" class="sb-slider">

<li>

<img src="images/1.jpg" alt="image1"/>

</li>

<li>

<img src="images/2.jpg" alt="image2"/>

</li>

<li>

<img src="images/3.jpg" alt="image2"/>

</li>

<li>

<img src="images/4.jpg" alt="image2"/>

</li>

<li>

<img src="images/5.jpg" alt="image2"/>

</li>

</ul>

<div>

<span onclick="$slicebox.previous();">上一頁</span>

<span onclick="$slicebox.next();">下一頁</span>

<span onclick="$slicebox.jump(4);">跳頁</span>

</div>

3.函數調用

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

<script type="text/javascript">

var $slicebox; $(function() {

$slicebox = $('#sb-slider').slicebox({

interval:6000,

orientation : "r", //表示投影片的切換方向,可取 (v)垂直方向, (h)水平方向 or (r)隨機方向

perspective : 800, //透視點距離,可以通過改變其值查看效果

cuboidsCount : 5, //投影片橫向或縱向被切割的塊數,切割的每一塊將會以3D的形式切換

cuboidsRandom : true, //是否隨機 cuboidsCount 參數的值

maxCuboidsCount : 5, //設定一個值用來規定最大的 cuboidsCount 值

colorHiddenSides : "#333", //隱藏的投影片的顏色

sequentialFactor : 150, //投影片切換時間(毫秒數)

speed : 600, //每一塊3D立方體的速度

autoplay : true, //是否自動開始切換

onBeforeChange : function(position) { return false; },

onAfterChange : function(position) { return false; }

});

});

</script>

參數說明:
orientation : "r", //表示投影片的切換方向,可取 (v)垂直方向, (h)水平方向 or (r)隨機方向
perspective : 800, //透視點距離,可以通過改變其值查看效果
cuboidsCount : 5, //投影片橫向或縱向被切割的塊數,切割的每一塊將會以3D的形式切換
cuboidsRandom : true, //是否隨機 cuboidsCount 參數的值
maxCuboidsCount : 5, //設定一個值用來規定最大的 cuboidsCount 值
colorHiddenSides : "#333", //隱藏的投影片的顏色
sequentialFactor : 150, //投影片切換時間(毫秒數)
speed : 600, //每一塊3D立方體的速度
autoplay : true, //是否自動開始切換

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.