<style> #selbigad{position:relative;} #adClose{position:absolute;right:0;top:0;width:35px;height:16px;} #adClose i{color:#FFF;font-weight:bold;font-size:14px;float:left;text-align:right;width:20px;line-height:16px;} #adClose span{width:15px;height:15px;float:right;background:url(http://img.ccoo.cn/v10//images/coioc.gif) 0px -385px no-repeat;cursor:pointer;} #adClose span.kai{background-position:0px -370px;} </style> <div class="box pt5"><div id="selbigad"><a href="http://www.baidu.com"><img src="http://photo.ccoo.cn/ad/danzhou/201351616463754.jpg" width="950" big="http://photo.ccoo.cn/ad/danzhou/201351616463754.jpg" sid="http://photo.ccoo.cn/ad/danzhou/201351616475251.jpg" /></a></div></div>
<script type="text/javascript">
var adate = 10;
function daojishi() {
$("#adClose i").html(adate);
adate--;
if (adate < 0) {adclose()}
};
var intervalid;
function adclose() {
clearInterval(intervalid);
$("#selbigad").stop().animate({height: "60px"},800,function() {
$("#selbigad img").attr("src", $("#selbigad img").attr("sid"));
$("#selbigad span").addClass("kai")
$("#adClose i").html("")
})
};
$("#selbigad").append("<div id='adClose'><i></i><span></span></div>");
$("#selbigad span").click(function() {
if ($(this).attr("class") != "kai") {
$("#adClose i").html("");
adclose()
} else if ($(this).attr("class") == "kai") {
$("#selbigad img").attr("src", $("#selbigad img").attr("big"));
$("#selbigad").stop().animate({height: "500px"},800,function() {
$("#selbigad span").removeClass("kai");
adate = 10;
intervalid = setInterval("daojishi()", 1000)
})
}
});
intervalid = setInterval("daojishi()", 1000);
</script>