CSDN博客

img oceayan

一段js代码模仿实现sina广告条--转自griefforyou的程序人生

发表于2004/9/17 21:44:00  968人阅读

<script>
var flag=0;
function play()
{
 switch(flag){
 case 0:
  flag=1;
  video.style.display="none";
  reSize(10);
  break;
 case 1,3:
  return;
  break;
 case 2:
  flag=3;
  video.style.display="none";
  reSize(-10);
 }
}

function reSize(dy)
{
 panel.style.posHeight+=dy;
 if((panel.style.posHeight<300&&dy>0)||(panel.style.posHeight>100&&dy<0))
window.setTimeout("reSize(" + dy + ")",100);
 else {
  video.style.display="";
  if(dy>0) {swf.height=300;flag=2;cmdPlay.innerText='关闭';}
  if(dy<0) {swf.height=85;flag=0;cmdPlay.innerText='重放';}
 }
}
</script>
<table width=778 border=0 align=center>
<tr>
<td>
<div style="background-color:black;width:778px;height:100px;" id="panel">
<div id="video">
<object id="swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version
=5,0,0,0" width="778" height="85">
<param name=movie
value="http://adimages.sina.com.hk/BBTV2_0804_espn2_sina760x90.swf?clickTAG=http://oa
scentral.sina.com.hk/RealMedia/ads/click_lx.ads/hk.sina.com/clickscommand/1234/Bottom
1/Sina.com/HK_BBTV_0704_HP_Curtain/textlink.gif/1">
<param name=quality value=high>
<embed
src="http://adimages.sina.com.hk/BBTV2_0804_espn2_sina760x90.swf?clickTAG=http://oasc
entral.sina.com.hk/RealMedia/ads/click_lx.ads/hk.sina.com/clickscommand/1234/Bottom1/
Sina.com/HK_BBTV_0704_HP_Curtain/textlink.gif/1" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=S
hockwaveFlash" type="application/x-shockwave-flash" width="85" height="85">
</embed> </object>
</div>
<br>
</div>
<div style="text-align:center;background-color:black">
<a href="javascript:void(null)" onclick="javascript:play()" id="cmdPlay"
style="color:yellow">播放</a>
</div>
</td>
</tr>
</table>

0 0

相关博文

我的热门文章

img
取 消
img