下面的代码放到你的页面<body>里就行了
<input type="button" name="Button" value="Button" onClick="lansa.style.display='block'">
<div id="lansa" style="display:none;width:200px;height:200px;border:1px solid #cccccc;padding:50px">
<form name="form1" method="post" action="">
<input name="Reset" type="reset" value="Reset" onClick="lansa.style.display='none'">
</form>
</div>
<input type="button" name="Button" value="Button" onClick="lansa.style.display='block'">
<div id="lansa" style="display:none;width:200px;height:200px;border:1px solid #cccccc;padding:50px">
<form name="form1" method="post" action="">
<input name="Reset" type="reset" value="Reset" onClick="lansa.style.display='none'">
</form>
</div>
解决方案 »
- 分享智能伸展
- 文本编辑器CKeditor插入图片的问题
- 请教jquery uploadify的疑问
- 关于stack overflow 的问题
- 请问怎样验证带汉字的文本框输入的字符长度
- 如何让对象里面每一个会员都有相同的方法?
- 关于删除数组Array元素的问题,splice()在IE下的使用方法~~~~~~~~~~~~~~~~
- 如何使页面链接href文字变色??
- [新人]鼠标移到img上,显示div,离开img时div隐藏,如果离开img但是还在显现的div上则不隐藏,现在问题是显现出来的div会撑开整个容器。
- for循环读取i值
- 如何将javascript中变量的值显示在html页面中?
- 请问关于菜单的问题
<div id="lansa" style="position:absolute; display:none;left:342px; top:227px; width:303px; height:150px; z-index:1">
<form name="form1" method="post" action="">
<input name="Reset" type="reset" value="Reset" onClick="lansa.style.display='none'">
</form>
</div>
<HEAD>
<TITLE> Drag Div </TITLE>
<script language = "JavaScript" >
<!--
var dragon=false;
function dragEvnt()
{
if (dragon)
{
var WIN=window.event;
var EL=document.all["lansa"].style;
EL.top=WIN.y-10;
EL.left=WIN.x-10;
}
}
//-->
</script>
</HEAD>
<BODY onMouseMove="dragEvnt()">
<BR><BR><BR>
<input type="button" name="Button" value="Button" onClick="lansa.style.display='block'">
<div id="lansa" onmousedown="dragon=true" onmouseup="dragon=false;" style="position:absolute; display:none;left:342px; top:227px; width:303px; height:150px; z-index:1;background-color:#3399CC">
<form name="form1" method="post" action="">
<input name="Reset" type="reset" value="Reset" onClick="lansa.style.display='none'">
</form>
</div></BODY>
</HTML>