什么叫可拖动的?试着这样的吗
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<SCRIPT LANGUAGE="JavaScript">
<!--
function chooseCigBrand(){          showx = (screen.width - 405 )/2;
      showy = (screen.height - 342 )/2;
      var rsValue = window.showModalDialog("a.html", "", "dialogWidth:405px; dialogHeight:342px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );}//-->
</SCRIPT>
</head><body>
<INPUT type="button" value="弹出页面" onclick="chooseCigBrand();return false;" style="cursor:hand;" >
</body>
</html>

解决方案 »

  1.   

    function LoginDisk()
    {      MaskDiv()
            var createDiv = document.createElement("div");
             createDiv.setAttribute("id","loginDiv");
     createDiv.style.position="absolute";
     createDiv.style.width="243px";
     createDiv.style.height="200px";
     createDiv.style.zIndex="55555666";
     //createDiv.style.backgroundColor="#000000";
     createDiv.style.display="block";
     createDiv.style.borderBottomWidth="1px";
     createDiv.style.borderBottomColor="#0066CC";
     //createDiv.style.backgroundColor="#999999";
     document.body.appendChild(createDiv); //alert("ww")
     var bodyh= screen.availHeight; 
     var bodyw=document.body.clientWidth;
     var objw=createDiv.clientWidth;
     var objh=createDiv.clientHeight; createDiv.style.left= (bodyw-objw)/2;
     //DivRecom.style.top = (bodyh-objh)/2;
     createDiv.style.top=(bodyh-objh)/4;
     //创建登陆层头部
     var HeadDiv=document.createElement("div");
     HeadDiv.style.height="30px";
     HeadDiv.style.width="100%";
     HeadDiv.style.backgroundColor="#0066CC";
     HeadDiv.style.borderBottom="1px solid #666666";
     /*
    HeadDiv.onmousedown=Milan_StartMove(event,'loginDiv');
    HeadDiv.onmouseup=Milan_StopMove(event,'loginDiv');
    HeadDiv.style.cursor="move";
    */
    HeadDiv.style.fontSize="14px";
    HeadDiv.style.color="#ffffff";
    HeadDiv.style.fontWeight="bold";
    HeadDiv.style.lineHeight="30px";
     HeadDiv.innerHTML="用户登录";
     HeadDiv.style.textAlign="center";
     createDiv.appendChild(HeadDiv);
     //创建内容层
      var CountentDiv=document.createElement("div");
     CountentDiv.style.height="170px";
     CountentDiv.style.width="100%";
     CountentDiv.setAttribute("id","loginDivCont");
     CountentDiv.style.backgroundColor="#ffffff";
     CountentDiv.style.color="#000";
     //HeadCountent.style.borderBottom="1px solid #666666";
     createDiv.appendChild(CountentDiv);
     var str;
    //str="<form name='form1' method='post' action='Login.aspx?name=textfieid.values'>";
    /*
    str+="<table width='100%' height='22' border='0' cellpadding='0' cellspacing='0' style='font-size:12px;'><tr>"
    str+="<td align='center' bgcolor='#999999'>用户登录</td></tr></table>"
    */str="<table width='243' height='' border='0' align='center' cellpadding='0' cellspacing='0' style='font-size:12px;'>"
      str+=" <tr> <td width='70' height='30' align='right' valign='bottom'>用户名:</td><td width='173' valign='bottom'><input type='text' size='11'style='with:30px' id='textfield' name='textfield'></td></tr>";
      str+=" <tr><td align='right' height='30' valign='bottom'>密码:</td><td width='173' valign='bottom'><input type='password' size='13' style='with:30px' id='textfield2' name='textfield2'></td></tr>";
        str+="<tr><td align='right' height='30'>验证码:</td><td height='30'><input type='text' size='5' id='verifyCode'><img src='AjaxImage.aspx' /></td></tr>";
       str+="<tr><td valign='bottom'align='right' height='30'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
       str+="</td><td valign='bottom'><label><input type='button'  name='Submit' onclick='submitAjax()' value='登陆'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name='Submit2' type='button' onClick='hidden();'value='取消'>";
       
    str+="</label></td></tr></table>";

    document.getElementById("loginDivCont").innerHTML=str;}//创建遮罩层
    function MaskDiv()
    {
    var createMask=document.createElement("div");
    createMask.style.position="absolute";
    createMask.style.backgroundColor="#000";
    createMask.style.left="0px";
    createMask.style.width= "100%";
    createMask.setAttribute("id","MaskDiv");
    createMask.style.top="0px";
    createMask.style.height= screen.availHeight;
    createMask.style.filter="alpha(opacity=60)";
    createMask.style.zIndex="55555665";
    document.body.appendChild(createMask);
    }
    //取消触发函数,隐藏相关层
    function hidden()
    {
    document.getElementById("MaskDiv").style.display='none';
    document.getElementById("loginDiv").style.display='none';
    }
    var http_requestDiv=false;这个代码 本来 是AJax动态登录的
     包括 遮罩层 看能否对你有帮助!!  
      
      

  2.   

    http://www.scriptlover.com/controls/EasyWindow/EasyWindow.html
      

  3.   

    http://www.scriptlover.com/controls/EasyWindow/EasyWindow.html是怎么实现的?关注!