WEB前端开发群:17784629
<SCRIPT> function show(){ window.event.cancelBubble = true var divId=document.getElementById("date"); divId.style.display="block"; } function hideDiv(){ var divId=document.getElementById("date"); if(!checkEventObj(event.srcElement,"date")) divId.style.display="none"; } function checkEventObj(obj,idName){ if(obj.tagName == "BODY"){ return false; } if(obj.id == idName){ return true; } else{ return checkEventObj(obj.parentElement, idName); } } </SCRIPT> <META content="MSHTML 6.00.2800.1515" name=GENERATOR></HEAD> <BODY onclick = hideDiv()> <div id=abc></div> <INPUT onclick=show() type=submit value=选择日期 name=Submit> <DIV id=date style="display:none; BORDER: #000 1px solid; POSITION: absolute; HEIGHT: 139px; WIDTH: 178px; left:87px; top: 14px;"> 1 2 3 4 5 6 7 <table width="100%" height="95" border="1" cellpadding="1" cellspacing="0"> <tr id=ab> <td>点击层中<span style="color:#f00">子元素</span>,不会隐藏</td> </tr> </table> </DIV>
提示:你可以先修改部分代码再运行。
Posted in 前端特效.
Tagged with 弹出, 按钮, 隐藏.
No comments
By yflintao – 2010年06月11日
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
留下评论 Cancel Some HTML is OK
Name (required)
Email (required, but never shared)
Web
or, reply to this post via trackback.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.