对联广告在部分广告站中是必须的,大多采用JS的方式,因为可关闭,而纯CSS的js
下载:
对联广告.zip(其中需要广告图片路径,请注意修改)
如上图的代码:
<!doctypehtml><html><head><metacharset="utf-8"><title>对联广告</title><scriptsrc="ad.js"></script></head><body><style>/*a{position:fixed;top:100px;}*/</style><script>functionad_left(){varhtml;html=<divid="ad_left"style="position:absolute;width:130px;height:300px;z-index:10001"><astyle="position:absolute;top:-15px;left:0;"href="javascript:void(0);"onclick="document.getElementById(\ad_left\).style.display=\ one\\">关闭</a><ahref="http://www.jq-"><imgsrc="ad.jpg"width="130"height="300"/></a></div>;dom.insertHtml(html);position.floatLeftCenter(ad_left);}functionad_right(){varhtml;html=<divid="ad_right"style="position:absolute;width:130px;height:300px;z-index:10001"><astyle="position:absolute;top:-15px;right:0;"href="javascript:void(0);"onclick="document.getElementById(\ad_right\).style.display=\ one\\">关闭</a><ahref="http://www.jq-"><imgsrc="ad.jpg"width="130"height="300"/></a></div>;dom.insertHtml(html);position.floatRightCenter(ad_right);}myEvent.add(window,load,ad_left);myEvent.add(window,load,ad_right);</script></body></html>