87,914
社区成员
发帖
与我相关
我的任务
分享
function move(){
var firstElement_height=$("#panent").find("div:first").height();
$("#panent").animate({marginTop: -firstElement_height-11+"px"},1000,function(){
var tempElement = $("#panent").find("div:first").clone(true);
$("#panent").find("div:first").remove();
$("#panent").append(tempElement );
}
}
setInterval(move,3000);
d= document.createElement("div"),
ie=!+"\v1",
clean= function (dom) {
var sons= dom.childNodes,uid=dom.$UID;
if(sons && sons.length==0) {
var i= sons.length ;
while(i--){
if(sons[i].nodeType ==1)
clean(sons[i]);
};
}
//这个是自己实现的cache,jQuery有他自己的,
if(uid != null){
delete _eleDatas[uid];
delete _collected[uid];
}
if (dom.removeEvents) dom.removeEvents(); //ie也知道它有bug,但只放出这个,它自动的不会,还要我们帮忙
if (dom.clearAttributes) dom.clearAttributes(); //同上
sons=i=uid=null;
return dom;
},
delDom= ie?function (dom) { //ie的removeChild有bug,要这样才能彻底删除
clean(dom);
d.appendChild(dom);
d.innerHTML="";;
}:function (dom) {
clean(dom);
if(dom.parentNode) dom.parentNode.removeChild(dom);
};
window.attachEvent('onload',function(){
document.getElementById('dele').attachEvent('onclick',function(){
document.getElementById('logoParent').removeChild(document.getElementById('logo'));
});
})
我都这样做了,还是这样,,弄的我也郁闷了,你确定这个玩意准???
<div id = "logoParent">
<div id="logo">
</div>
$("#logoParent").find("#logo").remove();
var div = $("#panent").find('div');
for(var i=0,len=div.length;i<len;i++){
div[i].someAttr = 'attrvalue'+i;
}
如果做过这样的操作,在IE下溢出是必然的。