`
sealbird
  • 浏览: 571509 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

背投广告

阅读更多
<!--背投广告代码 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-->
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics