中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

jQuery旋轉(zhuǎn)插件—rotate

2019-04-03    來源:css88.com

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

網(wǎng)上發(fā)現(xiàn)一個很有意思的jQuery旋轉(zhuǎn)插件,支持Internet Explorer 6.0+ 、Firefox 2.0 、Safari 3 、Opera 9 、Google Chrome,高級瀏覽器下使用Transform,低版本ie使用VML實現(xiàn)。調(diào)用和方法:

rotate(angle)angle參數(shù):[Number] – 默認為 0 – 根據(jù)給定的角度旋轉(zhuǎn)圖片例如:1$(“#img”).rotate(45);

rotate(parameters)parameters參數(shù):[Object] 包含旋轉(zhuǎn)參數(shù)的對象。支持的屬性:angle屬性:[Number] – default 0 – 旋轉(zhuǎn)的角度數(shù),并且立即執(zhí)行

例如:1$(“#img”).rotate({angle:45});

bind屬性:[Object] 對象,包含綁定到一個旋轉(zhuǎn)對象的事件。事件內(nèi)部的$(this)指向旋轉(zhuǎn)對象-這樣你可以在內(nèi)部鏈式調(diào)用- $(this).rotate(…)。例如 (click on arrow):01$(“#img”).rotate({bind:{

02

03click: function(){

04

05$(this).rotate({

06

07angle: 0,

08

09animateTo:180

10})

11}

12}

13});

animateTo屬性:[Number] – default 0 – 從當前角度值動畫旋轉(zhuǎn)到給定的角度值 (或給定的角度參數(shù))例如: 結(jié)合上面的例子,請參閱使用。

duration屬性:[Number] – 指定使用animateTo的動畫執(zhí)行持續(xù)時間例如 (click on arrow):01$(“#img”).rotate({bind:{

02click: function(){

03$(this).rotate({

04duration:6000,

05angle: 0,

06animateTo:100

07})

08}

09}

10});

step屬性:[Function] – 每個動畫步驟中執(zhí)行的回調(diào)函數(shù),當前角度值作為該函數(shù)的第一個參數(shù)

easing屬性:[Function] – 默認 (see below) – Easing function used to make animation look more natural. It takes five parameters (x,t,b,c,d) to support easing from http://gsgd.co.uk/sandbox/jquery/easing/ (for more details please see documentation at their website)。 Remember to include easing plugin before using it in jQueryRotate!Default function:1function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }

Where:t: current time,

b: begInnIng value,

c: change In value,

d: duration,

x: unused

No easing (linear easing):1function(x, t, b, c, d) { return (t/d)*c ; }

Example (click on arrow):01$(“#img”).rotate({bind:{

02click: function(){

03$(this).rotate({

04angle: 0,

05animateTo:180,

06easing: $.easing.easeInOutElastic

07})

08}

09}

10});

callback屬性:[Function] 動畫完成時執(zhí)行的回調(diào)函數(shù)例如 (click on arrow):01$(“#img”).rotate({bind:{

02

03click: function(){

04$(this).rotate({

05angle: 0,

06animateTo:180,

07callback: function(){ alert(1) }

08})

09}

10}

11});

getRotateAngle這個函數(shù)只是簡單地返回旋轉(zhuǎn)對象當前的角度。例如:1$(“#img”).rotate({

2angle: 45,

3bind: {

4click : function(){

5alert($(this).getRotateAngle());

6}

7}

8});

stopRotate這個函數(shù)只是簡單地停止正在進行的旋轉(zhuǎn)動畫。例如:01$(“#img”).rotate({

02bind: {

03click: function(){

04$(“#img”).rotate({

05angle: 0,

06animateTo: 180,

07duration: 6000

08});

09setTimeout(function(){

10$(“#img”).stopRotate();

11}, 1000);

12}

13}

14});

用這個可以實現(xiàn)很多關(guān)于旋轉(zhuǎn)的網(wǎng)頁特效,我用這個做了個抽獎大轉(zhuǎn)盤,效果不錯,就是沒flash順暢,基本能跑哈哈。jqueryrotate項目地址:http://code.google.com/p/jqueryrotate/代碼示例:http://code.google.com/p/jqueryrotate/wiki/Examples

標簽: jQuery插件 rotate Google 

版權(quán)申明:本站文章部分自網(wǎng)絡,如有侵權(quán),請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:界面微質(zhì)感探究

下一篇:如何進入 WZor,率先獲取泄露系統(tǒng)?