js层跟随鼠标移动函数
function badAD(html){
if(document.getElementById("styy"))return;
var aa=document.body.appendChild(document.createElement('div'));
aa.id="sttt";
var ad=aa.appendChild(document.createElement('div'));
ad.style.cssText="border:1px solid #ff6600;background:#ff5500;width:80px;height:32px;position:absolute;padding:4px 4px 4px 4px;font: 12px/1.5 verdana;";
ad.innerHTML=html||'This is bad idea!';
ad.id="styy";
var c=ad.appendChild(document.createElement('span'));
c.innerHTML="图片";
c.style.cssText="position:absolute;right:4px;top:2px;cursor:pointer";
//c.onclick=function (){
// document.onmousemove=null;
// this.parentNode.style.left='-99999px'
//};
document.onmousemove=function (e){
e=e||window.event;
var x=e.clientX,y=e.clientY;
setTimeout(function() {
//if(ad.hover)return;
if(x>1000){x=1000;}
if(y>600){y=600;}
ad.style.left=x+5+'px';
ad.style.top=y+5+'px';
},10)
}
//ad.onmouseover=function (){
// this.hover=true
//};
//ad.onmouseout=function (){
// this.hover=false
//}
}
//]]>