`

DIV弹出框

    博客分类:
  • JS
DIV 
阅读更多

比如在某个商城中,将一件商品加入购物车,按了按钮后弹出DIV框:

function inputadd(goodsid){
	    document.getElementById("gidtemp").value=goodsid;
		//document.getElementById("ggnum").focus();
		document.getElementById("showwin").style.display="block";
	}

 

DIV框显示出来:

<div id="showwin" style='display:none;position:absolute;left:30%;top:30%;border:1px solid gray;background:url(<%=path%>/manager/images/bg2.gif);width:255px;height:113px;-moz-border-radius: 5px; -webkit-border-radius: 5px;box-shadow:#000 0 0 5px; border-radius:5px;'>
<span style="display:block;height:18px;padding-top:6px;">&nbsp;操作提示</span>
<div style='border:3px solid #F0F0F0;height:80px;width:249px;background-color:#FFFFFF;'>
  <div style='width:99%;height:100%; border:1px solid #B6BCCC;background-color:#FFFBFF;'>
    <table width='100%' height='98%'>
	<tr><td height='40' align='center'><font color="#000" id="colors">请输入购买数量:</font><input style='width:120px;'  id="ggnum" type='text' value=''/></td></tr>
	<tr><td align='center'><input type='button' value='确定' onclick="addshopcar();" id='queding' />&nbsp;&nbsp;<input type="button" value='取消' onclick="closeadd();"/></td></tr>
	</table>
	</div>
	</div>
	</div>


按了上面的取消后,再将上面的DIV隐藏:

function closeadd(){
		document.getElementById("gidtemp").value="";
		document.getElementById("showwin").style.display="none";
	} 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics