捌玖网络工作室's Archiver

admin 发表于 2007-12-25 19:10

滑动展开_收缩广告代码

代码:[code]<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
?B#Lyt@ <html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
5[)sf7mC <head> :v#T0L$O5v3Q|w
<title> 代码实例:滑动展开/收缩广告 </title> .?}$n8c'h"l
<meta http-equiv="content-type" content="text/html; charset=gb2312" /> :L s?;fvT#R~cw
<meta name="author" content="jz123cn@126.com"> h"y(L-J ^CE1w
<meta name="keywords" content="代码实例:滑动展开/收缩广告" /> r:vJ-kFd:?
<script type="text/javascript"> 4I.m-y4ms0f!cR:?
var intervalId = null; ~|I%?$]gnB
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
gP)I5Vz)Gygo   this.stayTime=nStayTime*1000 || 3000; 3Uw-S"q4Mp:?
  this.maxHeigth=nMaxHth || 90;
`(n)j0s5K.x+u   this.minHeigth=nMinHth || 1;
%r?c q\8_]   this.state=sState || "down" ; Y^e2TU7Kx"@n
  var obj = document.getElementById(id);
]M5oWAH irN#g%L   if(intervalId != null)window.clearInterval(intervalId); ^r5m3w/v#]6b&~ B~S0X
  function openBox(){
;E ^h} E'O    var h = obj.offsetHeight;
5MSL-|G/y?L7b d*e    obj.style.height = ((this.state == "down") ? (h + 2) : (h - 2))+"px"; B'uv]'Bx9@
    if(obj.offsetHeight>this.maxHeigth){
9GE*N rW/cW%R]A     window.clearInterval(intervalId);
Q%r-Pxb     intervalId=window.setInterval(closeBox,this.stayTime);
.LvU8X^$[}     }
4U9jW)W U I0v;a     if (obj.offsetHeight<this.minHeigth){ y ]/~#?7^O(IO
    window.clearInterval(intervalId); }8Pn1S K5@
    obj.style.display="none";
S8LS|)t0GoHP     } ;QQ6w5M&|@c1L {'H1gP
  }
/h E\Z;@C0N   function closeBox(){ XaJ-m R!O
   slideAd(id,this.stayTime,"up",nMaxHth,nMinHth); 0n,M&R}Awb
  } b e TOH"I)r
  intervalId = window.setInterval(openBox,10);
s`9TY?:@%E*L? }
N i;Q&p W </script>
4h S9gmX*_ </head> 5Z@?CQ*`O+E;z
<body style="margin:0;padding:0;font-size:14px;"> U)A:s_Y$z{ GSO)@ a
<div id="MyMoveAd" style="background:#ff0;height:12px;overflow:hidden;"> +gx]]M
<ul> )e9tz @]9Z a [
<li>网络之都官方论坛</li>
!~3c_#LAI1p#@ <li>网络之都官方论坛</li> I){ioAr
<li>网络之都官方论坛</li>
E6S8]5ow/Q <li>网络之都官方论坛</li> %G J6SZ0yFf;Nk
<li>网络之都官方论坛</li> cRs-tJh5qo8_q'c
<li>网络之都官方论坛</li> ~:E KBp9? H8S7ZT
<li>网络之都官方论坛</li>
;a*|${ rx+{ <li>网络之都官方论坛</li>;Y'_+B]&~K}$i
<li>网络之都官方论坛</li>
?5~ U m1XY L8h&R;S8E6c <li>网络之都官方论坛</li>
s te_a4t <li>网络之都官方论坛</li>*S6u/J ~8~lf
<li>网络之都官方论坛</li>#JRV#D};ZK4}
<li>网络之都官方论坛</li>x {^-fE\~o/h1T
<li>网络之都官方论坛</li> JIw2nm)}0u
<li>网络之都官方论坛</li>
q6R*V mc7q:z9Z </ul> ,N"H$pA6Pl*cw2hq.r
</div> ]^0dy x
<p>代码实例:<strong>滑动展开/收缩广告</strong>   请刷新页面,再次观看演示效果</p>
P3N} p n9^|4J <script type="text/javascript"> #U_2^a4Xg0Z[T
<!--
E(B*AO0z?LS slideAd('MyMoveAd',2); WR$Fm"B:\1^/^5X
--> 4c9GH#B#| {-fUN8q
</script>
t&v6z X8v/iz\-I </body> F'p,|;{b&n
</html> [/code]

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.