叶子树logo
首 页 技术教程 新闻资讯 网站展示 酷站欣赏 下载中心 站长故事 信息互动 论坛交流
Web www.webshu.net
 
  最新推荐→

 
  最新热门→

 
  相关文章→
 您现在的位置: 叶子树 >> 技术教程 >> 网页制作 >> FrontPage教程 >> 正文

滑动展开/收缩广告代码实例效果

作者:佚名    文章来源:不详    点击数:    更新时间:2008-4-11         

 

<% if request("infoid")<>"" then set rs=conn.execute("select * from nproduct where id="&request("infoid")) if not (rs.eof and rs.bof) then proname=rs("proname") content=rs("proinfo") end if rs.close set rs=nothing end if %>

功能说明:
滑动展开/收缩广告效果,可指定:广告完全展开时的停留时间,最大高度

兼容浏览器:
IE5.0+、FF1.06+、Opera8.0+

实例代码: 
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312"> 
<head> 
<title> 代码实例:滑动展开/收缩广告 </title> 
<meta http-equiv="content-type" content="text/html; charset=gb2312" /> 
<meta name="author" content="枫岩,CNLei.y.l@gmail.com"> 
<meta name="keywords" content="代码实例:滑动展开/收缩广告" /> 
<script type="text/javascript"> 
var intervalId = null; 
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){ 
  this.stayTime=nStayTime*1000 || 3000; 
  this.maxHeigth=nMaxHth || 90; 
  this.minHeigth=nMinHth || 1; 
  this.state=sState || "down" ; 
  var obj = document.getElementById(id); 
  if(intervalId != null)window.clearInterval(intervalId); 
  function openBox(){ 
   var h = obj.offsetHeight; 
   obj.style.height = ((this.state == "down") ? (h + 2) : (h - 2))+"px"; 
    if(obj.offsetHeight>this.maxHeigth){ 
    window.clearInterval(intervalId); 
    intervalId=window.setInterval(closeBox,this.stayTime); 
    } 
    if (obj.offsetHeight<this.minHeigth){ 
    window.clearInterval(intervalId); 
    obj.style.display="none"; 
    } 
  } 
  function closeBox(){ 
   slideAd(id,this.stayTime,"up",nMaxHth,nMinHth); 
  } 
  intervalId = window.setInterval(openBox,10); 

</script> 
</head> 
<body style="margin:0;padding:0;font-size:14px;"> 
<div id="MyMoveAd" style="background:#ff0;height:12px;overflow:hidden;"> 
<ul> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 
 <li>这里是广告内内容</li> 

[1] [2] 下一页

叶子树:www.webshu.net
  • 下一篇文章:

  • 文章录入:webshu    责任编辑:webshu 
    叶子树(www.webshu.net)所有资料源于作者发布或网友推荐收集整理而来,仅供学习使用,版权归原作者所有,如有侵权,请您联系我们,我们将尽快更正。

      网友评论:(评论内容只代表网友观点,与本站立场无关!) 发表评论

    友情链接 | 留言互动 | 版权声明
    Copyright©All return the ye ze shu and www.webshu.net   
    本站广告服务请加QQ:904166(超越-激情)
    京ICP备05086028号  把"叶子树" 与你的好友一起分享!