DIV CSS 佈局教程網

jQuery Rotate 旋轉插件:跨瀏覽器角度動畫
編輯:JQuery特效代碼     

rotate() 基本用法

此 jQuery 旋轉插件可讓元素依指定角度旋轉,並支援動畫、回調與步驟函數。高階瀏覽器使用 CSS Transform,舊版 IE 則以 VML 模擬。

$("#img").rotate(45);
$("#img").rotate({ angle: 45 });
$("#img").rotate({
  bind: {
    click: function () {
      $(this).rotate({ angle: 0, animateTo: 180, duration: 6000 });
    }
  }
});

常用參數

  • angle:目前角度。
  • animateTo:動畫目標角度。
  • duration:動畫時間。
  • step:每步驟回調。
  • easing:緩動函數。
  • callback:動畫完成回調。

另有 getRotateAngle() 可取得目前角度,stopRotate() 可停止進行中的動畫,適合製作轉盤、旋轉提示與互動視覺。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved