<!--背投广告代码 begin-->
<script language="javascript" type="text/javascript">
(function () {
var pthis = this;
//获取cookie
this.getAdCookie = function (N) {
var c = document.cookie.split("; ");
for (var i = 0; i < c.length; i++) { var d = c[i].split("="); if (d[0] == N) return unescape(d[1]); }
return "";
};
//设置cookie
this.setAdCookie = function (N, V, Q) {
var L = new Date();
var z = new Date(L.getTime() + Q * 60000);
// document.cookie=N+"="+escape(V)+";path=/;expires="+z.toGMTString()+";";
document.cookie = N + "=" + escape(V) + ";path=/;domain=sina.com.cn;expires=" + z.toGMTString() + ";";
};
//构造函数
this.init = function () {
try {
document.write('\
<style type="text/css">\
body{background:url(http://images2.dichan.com/2010/bt_20100705.jpg) repeat-x top center}\
#DitanactiveBar{width:960px; margin:0 auto; height:110px;position:relative;}\
#DitanactiveBlank{clear:both;width:960px;height:0px;line-height:0;font-size:0;overflow:hidden;}\
</style>\
<div id="DitanactiveBar">\
<a href="http://bbs.dichan.com/expo/" target="_blank" style="display:block;text-indent: -999px; width:960px; height:100px;"></a>\
<div id="60Btncls" style="width:40px;height:18px;padding:0;margin:0;position:absolute;right:0;top:0;cursor:pointer;display:block;background:url(http://d2.sina.com.cn/shh/demo/090907/60_zty_cls2.jpg) no-repeat;z-index:2;" title="关闭背景"></div>\
</div>\
<div id="DitanactiveBlank" style="display:none;"></div>\
');
var tmpImg = document.createElement("img");
tmpImg.src = "http://d3.sina.com.cn/shh/demo/090907/60_zty_cls2.jpg";
jQuery('#60Btncls').mouseover(function () {
jQuery('#60Btncls').css('background', "url(http://d3.sina.com.cn/shh/demo/090907/60_zty_cls1.jpg) no-repeat");
});
jQuery('#60Btncls').mouseout(function () {
jQuery('#60Btncls').css('background', "url(http://d2.sina.com.cn/shh/demo/090907/60_zty_cls2.jpg) no-repeat");
});
jQuery('#60Btncls').click(function () {
document.body.style.background = "none";
jQuery('#DitanactiveBar').hide();
jQuery('#DitanactiveBlank').show();
pthis.setAdCookie("nasdaqcric1016", 0, 1440);
});
} catch (e) { }
}
var cookie = pthis.getAdCookie("nasdaqcric1016");
cookie = cookie == "" ? 1 : cookie;
if (cookie == 1) { pthis.init(); }
})();
</script> <style type="text/css"> body{background:url(http://images2.dichan.com/2010/bt_20100705.jpg) repeat-x top center} #DitanactiveBar{width:960px; margin:0 auto; height:110px;position:relative;} #DitanactiveBlank{clear:both;width:960px;height:0px;line-height:0;font-size:0;overflow:hidden;} </style> <div id="DitanactiveBar"> <a href="http://bbs.dichan.com/expo/" target="_blank" style="display: block; text-indent: -999px; width: 960px; height: 100px;"></a> <div id="60Btncls" style="margin: 0pt; padding: 0pt; background: transparent url(http://d2.sina.com.cn/shh/demo/090907/60_zty_cls2.jpg) no-repeat scroll 0% 0%; width: 40px; height: 18px; position: absolute; right: 0pt; top: 0pt; cursor: pointer; display: block; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; z-index: 2;" title="关闭背景"></div> </div> <div id="DitanactiveBlank" style="display: none;"></div>
<!--背投广告代码 end-->
分享到:
相关推荐
网页背投。JS网页背投广告代码。JS网页背投广告代码
定时关闭的背投广告,15.6KB
SOHU背投广告和弹出广告代码
右下角弹出关闭变背投广告代码
该压缩包中包含了如何制作带自动关闭功能的背投广告的相关源码及资料。
仿SOHU背投广告和弹出广告效果代码.zip
许多网站都有一个很好的大幅背投广告,这里提供的源码主是制作这样广告的。
javascript背投广告代码的完善.docx
discuz论坛插件DZ插件 55625背投广告大屏 拉幕 .
背投广告,播放完后弹回右下角,可重复播放!!
网页Flash背投广告和强制弹出窗口代码,背投广告相信大家都体验过,应该广告效果不错,不过有时候用户可能不太喜欢,广告要切合实际,不可损失太多的用户体验,否则对网站的影响还是比较大的。
主要介绍了JavaScript常用的弹出广告及背投广告实现方法,实例分析了弹出广告与背投广告的实现原理与相关技巧,需要的朋友可以参考下
对于背投广告的原理来说并没有什么难度,无非打开的窗口失去焦点(blur),而原来页面得到焦点(focus)。但对于流行的浏览器来说,如果非用户行为的弹出窗口(即 onload 时,直接window.open ),会被浏览器默认...
动态的长条广告,只需复制代码加入你的网页,即可增添动感效果
背投广告,既然被称为广告,那如何才能让广告主的钱花得实在,花得乐意呢? 我们可以增加判断,如果该弹出窗口被浏览器拦截,则只要用户点击页面就触发 window.open 事件,这样一般不会拦截,浏览器会认为这是用户...