求救!!!!js 一个网页第一次点击任何地方弹出广告页面,第二次就不会弹出jsJavaScript 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript"> window.onload=function(){ var div=document.getElementsByTagName("div")[0]; div.onclick=function(){ alert('ad'); div.onclick=null; } }</script></head><body><div style="position:absolute; left:0px; top:0px; width:100%; height:100%"><div>123</div><input type="button" value="ss" /><input type="text" value="text" /></div></body></html>类似这样试试 谢谢你,不过我要的不是这种效果啊!我要的是像这个网址那样的:http://www.3454.com/lol你试试看看那个效果 最上面 放一个 透明的div点了 出广告 然后 div消失 用jquery$(document).click(function(){ ......弹出广告 $(document).unbind("click");});或document.onclick=function(){ ......弹出广告 document.removeAttribute("onclick");}; jquery:$("body").one("click", function(){ alert("广告");}) JS 怎么控制 checkbox 选中 帮我释疑,谢谢 select options选项之间传送数值的问题,折磨我好几天了。。 按一次"回车"相当于按两次"回车" select 父子窗口的值传递 字符串替换 如何打印出WebBrowser中的内容?? 一个很急的问题?? 请教如何通过脚本改变OBJECT的属性值 關於select和focus的問題 可编辑下拉菜单请教! jquery多次触发div hover事件,百思不得其解,请各位指教!急急急急急急
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function(){
var div=document.getElementsByTagName("div")[0];
div.onclick=function(){
alert('ad');
div.onclick=null;
}
}
</script>
</head><body>
<div style="position:absolute; left:0px; top:0px; width:100%; height:100%">
<div>123</div>
<input type="button" value="ss" />
<input type="text" value="text" />
</div>
</body>
</html>
类似这样试试
你试试看看那个效果
点了 出广告 然后 div消失
$(document).click(function(){
......弹出广告
$(document).unbind("click");
});
或
document.onclick=function(){
......弹出广告
document.removeAttribute("onclick");
};
alert("广告");
})