请问怎么给右下角js广告代码增加关闭按钮?
请问怎么给下面这段右下角广告的js代码增加关闭按钮?谢谢。document.writeln("<styletype=\"text/css\">");document.wr...
请问怎么给下面这段右下角广告的js代码增加关闭按钮?谢谢。
document.writeln("<style type=\"text/css\"> ");
document.writeln("img{border:0px;} ");
document.writeln("#haoetv{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-150);cursor:pointer;} ");
document.writeln("#close{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-149);cursor:pointer;} ");
document.writeln("</style> ");
document.writeln("");
document.writeln("<div id=\"haoetv\" style=\"width:328px;height:150px;z-index:99;text-align:right; ");
document.writeln("");
document.writeln("float:right;margin:10px 15px -10px 0;\"> ");
document.writeln("<div><a href=\"#\" target=\"_blank\"><img ");
document.writeln("");
document.writeln("src=\"118/2.gif \" ></a></div> ");
document.writeln("");
document.writeln("</div>"); 展开
document.writeln("<style type=\"text/css\"> ");
document.writeln("img{border:0px;} ");
document.writeln("#haoetv{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-150);cursor:pointer;} ");
document.writeln("#close{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-149);cursor:pointer;} ");
document.writeln("</style> ");
document.writeln("");
document.writeln("<div id=\"haoetv\" style=\"width:328px;height:150px;z-index:99;text-align:right; ");
document.writeln("");
document.writeln("float:right;margin:10px 15px -10px 0;\"> ");
document.writeln("<div><a href=\"#\" target=\"_blank\"><img ");
document.writeln("");
document.writeln("src=\"118/2.gif \" ></a></div> ");
document.writeln("");
document.writeln("</div>"); 展开
2个回答
展开全部
118/2.gif是一个关闭按钮图片吗?
修改好了,点击右上角的图片可关闭广告。如下:
document.writeln("<style type=\"text/css\"> ");
document.writeln("img{border:0px;} ");
document.writeln("#haoetv{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-150);cursor:pointer;} ");
document.writeln("#close{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-149);cursor:pointer;} ");
document.writeln("</style> ");
document.writeln("");
document.writeln("<div id=\"haoetv\" style=\"width:328px;height:150px;z-index:99;text-align:right;background:red; ");
document.writeln("");
document.writeln("float:right;margin:10px 15px -10px 0;\">");
document.writeln("<div style='background:yellow;'><a href=\"javascript:void(0)\" onclick=\"document.getElementById('haoetv').style.display='none';\" target=\"_blank\"><img ");
document.writeln("");
document.writeln("src=\"118/2.gif \" ></a></div> ");
document.writeln("");
document.writeln("</div>");
有问题可以追问哦。
更多追问追答
追问
我是要点击右上角【关闭】这2个字就关闭广告图片。点击图片就可以进入另一个网站。用户可以自己选择关闭图片,还是点击图片进入到另一个网站。我现在的代码里面没有【关闭】这2个字的,所以不能选择关闭图片还是点击图片进入另一个网站。谢谢。
追答
OK!好了
document.writeln("<style type=\"text/css\"> ");
document.writeln("img{border:0px;} ");
document.writeln("#haoetv{position:fixed!important;position:absolute;right:0;bottom:0;top:expression ");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-150);cursor:pointer;} ");
document.writeln("#close{position:fixed!important;position:absolute;right:0;bottom:0;top:expression");
document.writeln("(offsetParent.scrollTop+offsetParent.clientHeight-149);cursor:pointer;} ");
document.writeln("</style> ");
document.writeln("");
document.writeln("<div id=\"haoetv\" style=\"width:328px;height:150px;z-index:99;text-align:right;");
document.writeln("float:right;margin:10px 15px -10px 0;\">");
document.writeln("<a href='javascript:void(0)' onclick=\"document.getElementById('haoetv').style.display='none';\">关闭</a>");
document.writeln("<div><a href=\"#\" target=\"_blank\"><img src=\"118/2.gif\" />");
document.writeln("</a></div> ");
document.writeln("");
document.writeln("</div>");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询