点击进入知科官方网站
查看: 1316  |  回复: 2
 
 
longfor
积分:1270
注册时间:2012-02-08
最后登录:2013-10-21
发送短消息
发表于 2013-09-21 11:58
页面地址:http://www.tj0454.com/

问题描述:
2.官方提供的没有这个灰色的渐变背景,他这个是怎么弄的


截图说明:
 
 
Official服务
积分:16745
注册时间:2012-01-02
最后登录:2015-09-24
发送短消息
回复于 2013-09-21 13:35
1楼
 <script type="text/javascript" src="/index/2/skin/jquery-1.4.2.min.js"></script>
<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" class="flow" style="height:0px;width:950px;"><a 
href="http://www.tj0454.com/news/1575.htm">
<img src="http://www.tj0454.com/p/gg/fullAd1/dazhe.jpg" width="950" 
big="http://www.tj0454.com/p/gg/fullAd1/dazhe.jpg" 
sid="http://www.tj0454.com/p/gg/wmcs.jpg" /></a></div></div>
<script type="text/javascript">
$("#selbigad").stop().animate({height: "300px"},800,function() {
})
 
var adate = 6;
function daojishi() {
$("#adClose i").html(adate);
adate--;
if (adate < 0) {adclose()}
};
var intervalid;
function adclose() {
clearInterval(intervalid);
$("#selbigad").stop().animate({height: "75px"},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: "300px"},800,function() {
$("#selbigad span").removeClass("kai");
adate = 6;
intervalid = setInterval("daojishi()", 1000)
})
}
});
intervalid = setInterval("daojishi()", 1000);
</script>
 
 
Official服务
积分:16745
注册时间:2012-01-02
最后登录:2015-09-24
发送短消息
回复于 2013-09-21 17:29
2楼
 
 
 
<div id="ad__" style="margin-top:5px;"><img src="http://www.yunxian58.com/p/00000.jpg" ></div>
<script type="text/javascript">
function HideAd__(o){
 var timer__ = setInterval(function(){
  if(o.offsetHeight > 70){
   o.style.height = o.offsetHeight - 10 + 'px';
  }
  else{
   o.style.height = '60px';
   o.innerHTML="<img src=\"http://www.yunxian58.com/p/11111.jpg\" />";
   return clearInterval(timer__);   
  }
 }, 10);
}
setTimeout(function(){
 return HideAd__(document.getElementById('ad__'));
}, 5000);
</script>
回复帖子