var str_url=window.location.href; var strout =''; strout=""; strout +=""; document.write(strout); strout="
"; strout+="
"; strout+="关闭"; strout+="
"; strout+="
"; strout+=""; strout+="
"; strout+="
"; strout+=""; strout+=""; strout+=""; strout+="
"; document.write(strout); var x0=0,y0=0,x1=0,y1=0; var moveable=false; var voltobj=document.getElementById('floatervolt'); var t0= parseInt(voltobj.style.top); //开始拖动; function startDrag(){ voltobj.setCapture(); //记录鼠标和层位置; x2=document.body.offsetWidth; x0 = event.clientX; y0 = event.clientY; if(voltobj.style.left==''){ x1 = x2-parseInt(voltobj.style.right)-parseInt(voltobj.style.width)-20; }else{ x1 = parseInt(voltobj.style.left); } y1 = parseInt(voltobj.style.top); moveable = true; } //拖动; function drag(){ if(moveable){ voltobj.style.left =x1+ event.clientX-x0; voltobj.style.top =y1+ event.clientY-y0; } } //停止拖动; function stopDrag(){ voltobj.releaseCapture(); moveable = false; } //window.onscroll = movevolt; function movevolt(){ voltobj.style.top=(t0+document.documentElement.scrollTop)+"px"; } function closevolt(){ voltobj.innerHTML=""; voltobj.style.display="none"; }