js实现可拖动alert div模拟层
2014-11-24 01:09:03
·
作者:
·
浏览: 0
<
html>
你可以拖动我吗?
<script language="java script">
<script language="java script">
this.doAlpha = function(){
if (c++ > 50){clearInterval(ad);return 0;}
shield.style.filter = "alpha(opacity="+c+");";
}
this.remove=function(){
alertFram.innerHTML="";
shield.style.filter = "";
shield.id = "";
shield.style.position = "";
shield.style.left = "";
shield.style.top = "";
shield.style.width = "";
shield.style.height ="";
shield.style.background = "";
shield.style.textAlign = "";
shield.style.zIndex = "";
shield.style.filter = "";
alertFram.id="";
alertFram.style.position = "";
alertFram.style.left = "";
alertFram.style.top = "";
alertFram.style.marginLeft = "";
alertFram.style.marginTop = "";
alertFram.style.width = "";
alertFram.style.height = "";
alertFram.style.background = "";
alertFram.style.textAlign = "";
alertFram.style.lineHeight = "";
alertFram.style.zIndex = "";
}
var ad = setInterval("doAlpha()",10);
alertFram.focus();
document.body.onselectstart = function(){return false;};
}
function oMove(obj){
var otop,oleft;
otop = event.y - obj.offsetTop;
oleft = event.x - obj.offsetLeft;
obj.setCapture();
obj. = function()
{
obj.style.left = event.x - oleft;
obj.style.top = event.y - otop;
}
obj. = function()
{
obj. = null;
obj.style.filter = null;
obj.releaseCapture();
}
}
//-->