Morf.jsCSS3 轉換函數定義
Morf.js 提供了一組 JavaScript 方法用于加速 CSS3 的各種轉換效果,支持的方法都在上圖中,無需編寫 CSS3 代碼。
示例代碼:
// Get a reference to the element
var elem = document.getElementById('elem');
var trans = Morf.transition(elem, {
// New CSS state
'-webkit-transform': 'translate3d(300px, 0, 0) rotate(90deg)',
'background-color': '#FF0000'
}, {
duration: '1500ms',
timingFunction: 'bounce',
callback: function (elem) {
// You can optionally add a callback option for when the animation completes.
}
});評論
圖片
表情
