国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

jQuery旋轉插件—rotate支持(ie/Firefox/SafariOpera/Chrome)

2024-05-06 14:19:53
字體:
來源:轉載
供稿:網友

網上發現一個很有意思的jQuery旋轉插件,支持Internet Explorer 6.0+ 、Firefox 2.0 、Safari 3 、Opera 9 、Google Chrome,高級瀏覽器下使用Transform,低版本ie使用VML實現。

調用和方法:

rotate(angle)

angle參數:[Number] – 默認為 0 – 根據給定的角度旋轉圖片

例如:
代碼如下:
$("#img").rotate(45);

rotate(parameters)

parameters參數:[Object] 包含旋轉參數的對象。支持的屬性:
1.angle屬性:[Number] – default 0 – 旋轉的角度數,并且立即執行
例如: 
代碼如下:
$("#img").rotate({angle:45});

2.bind屬性:[Object] 對象,包含綁定到一個旋轉對象的事件。事件內部的$(this)指向旋轉對象-這樣你可以在內部鏈式調用- $(this).rotate(…)。例如 (click on arrow):
代碼如下:
$("#img").rotate({bind:{

click: function(){

$(this).rotate({

angle: 0,

animateTo:180
})
}
}
});

3.animateTo屬性:[Number] – default 0 – 從當前角度值動畫旋轉到給定的角度值 (或給定的角度參數)例如: 結合上面的例子,請參閱使用。
4.duration屬性:[Number] – 指定使用animateTo的動畫執行持續時間例如 (click on arrow):
代碼如下:
$("#img").rotate({bind:{
click: function(){
$(this).rotate({
duration:6000,
angle: 0,
animateTo:100
})
}
}
});

5.step屬性:[Function] – 每個動畫步驟中執行的回調函數,當前角度值作為該函數的第一個參數
6.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:
代碼如下:
function (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):
代碼如下:
function(x, t, b, c, d) { return (t/d)*c ; }

Example (click on arrow):
代碼如下:
$("#img").rotate({bind:{
click: function(){
$(this).rotate({
angle: 0,
animateTo:180,
easing: $.easing.easeInOutElastic
})
}
}
});

7.callback屬性:[Function] 動畫完成時執行的回調函數例如 (click on arrow):
代碼如下:
$("#img").rotate({bind:{
click: function(){
$(this).rotate({
angle: 0,
animateTo:180,
callback: function(){ alert(1) }
})
}
}
});

getRotateAngle

這個函數只是簡單地返回旋轉對象當前的角度。

例如:
代碼如下:
$("#img").rotate({
angle: 45,
bind: {
click : function(){
alert($(this).getRotateAngle());
}
}
});

stopRotate

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 安平县| 留坝县| 简阳市| 赤峰市| 吴江市| 乌审旗| 双流县| 抚远县| 镇雄县| 探索| 承德县| 界首市| 莆田市| 辉南县| 阳原县| 高淳县| 桓仁| 元氏县| 新营市| 正宁县| 禹城市| 库尔勒市| 余庆县| 彰化县| 微博| 翁牛特旗| 山西省| 芦山县| 平原县| 辽源市| 曲麻莱县| 壶关县| 宁夏| 宝清县| 铁岭县| 道孚县| 澎湖县| 旅游| 洛浦县| 河北区| 松潘县|