常用的DOM操作、事件
来自:Dustin Diaz,我加上了删除事件。
var Dom =
if typeof el === 'string'
return documentgetElementById el;
else
return el;
var el = this get el;
var dest = this get dest;
destappendChild el;
var el = this get el;
elparentNoderemoveChild el;
;
var Event =
if window addEventListener
return function el type fn
Dom get el addEventListener type fnfalse;
;
else if window attachEvent
return function el type fn
var
fncall Dom get elwindowevent;
;
Dom get elattachEvent'on' + type f;
;
if window removeEventListener
return function el type fn
Dom get el removeEventListener type fnfalse;
;
else if window detachEvent
return function el type fn
Dom get eldetachEvent'on' + type;
;
;
使用时类似:Event.add('domId', 'click',install);
和 AS 中的 tweener 语法挺像的:
Tweener.addTween(event.displayObject3D, {
rotationY:180,
time:0.5,
transition:"easeOutQuart"
} );
Labels: dom, event, javascript
0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home