请问如何给层加个关闭按钮,谢谢
代码如下:<div id="Layer2">
<script type="text/javascript"><!--
google_ad_client = "pub-7693641693247086";
/* 300x250, 创建于 09-1-3 */
google_ad_slot = "8990281345";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
代码如下:<div id="Layer2">
<script type="text/javascript"><!--
google_ad_client = "pub-7693641693247086";
/* 300x250, 创建于 09-1-3 */
google_ad_slot = "8990281345";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
如果lz非要删除这个div的话就只有清空这个div里面的元素就行了$("#Layer2").html();
<div id="infoDIV">
<div style="width:200px;float:left;"> </div>
<div style="width:20px;float:left;" onclick="closeDIV()" onmouseover="this.style.cursor='hand'">关闭</div>
</div>
</div><script>
function closeDIV() {
var new_dialogue = document.getElementById("new_dialogue");
new_dialogue.parentNode.removeChild(new_dialogue);
}
</script>
<style type="text/css">
#new_dialogue {
margin: -250px 0 0 -250px;
position: absolute;
top: 50%;
left: 50%;
}
#infoDIV {
padding-top: 8px;
padding-left: 30px;
//background: transparent url(images/cart_info_bg.png) no-repeat scroll 0 0;
background-color: red;
width: 322px;
height: 95px;
position: absolute;
margin-top:50px;
margin-left:30px;
}
</style>
<div id="Layer2" ondbclick="this.style.display:none">
<script type="text/javascript"><!--
google_ad_client = "pub-7693641693247086";
/* 300x250, 创建于 09-1-3 */
google_ad_slot = "8990281345";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>