<style>
.ad_box { position:relative;display:none;margin-bottom:5px; }
.ad_box img { margin-left:10px; }
.ad_box img.closeAD { position:absolute;top:10px;right:20px;cursor:pointer; }
.reShowAd { width:15px;position:absolute;top:100px;right:-23px;display:none;padding:3px;border:1px solid #CCC;background:#FFF;cursor:pointer; }
.container { position:relative;overflow:visible; }
</style>
<div id="show_ad" class="ad_box">
<a href="#"><img src="images/2013.jpg" border="0" /></a>
<img src="images/dk_ad_closed.gif" border="0" id="closeAD" class="closeAD" />
</div>
<span class="reShowAd">重播</span>
<script>
jQuery.cookie=function(d,c,a){if("undefined"!=typeof c){a=a||{};null===c&&(c="",a=$.extend({},a),a.expires=-1);a.expires||(a.expires=1);var b="";if(a.expires&&("number"==typeof a.expires||a.expires.toUTCString))"number"==typeof a.expires?(b=new Date,b.setTime(b.getTime()+864E5*a.expires)):b=a.expires,b="; expires="+b.toUTCString();var e=a.path?"; path="+a.path:"",f=a.domain?"; domain="+a.domain:"",a=a.secure?"; secure":"";document.cookie=[d,"=",encodeURIComponent(c),b,e,f,a].join("")}else{c=null;
if(document.cookie&&""!=document.cookie){a=document.cookie.split(";");for(b=0;b<a.length;b++)if(e=jQuery.trim(a[b]),e.substring(0,d.length+1)==d+"="){c=decodeURIComponent(e.substring(d.length+1));break}}return c}};
$(function(){
var show = $.cookie('showAd');
if(!show){ showAd('#show_ad', 'show', 1000); }
$('#closeAD').click(function(){
showAd('#show_ad', 'close', 1000);
});
$('.reShowAd').click(function(){
showAd('#show_ad', 'show', 1000);
});
});
function showAd(id, type, time){
var date = new Date();
date.setTime(date.getTime() + (1440 * 60 * 1000));
$.cookie('showAd', true, {expires: date});
if(type == 'show'){
clearTimeout(ad);
$(id).slideDown(time);
setTimeout("$('.reShowAd').css('display', 'none')", 500);
var ad = setTimeout("showAd('#show_ad', 'close', 800)", 3000);
}else{
clearTimeout(ad);
$(id).slideUp(time);
var ad = setTimeout("$('.reShowAd').css('display', 'block')", 1100);
}
}
</script>
评论