图片移动代码寻求

beyondhai 2004-04-30 10:57:16
请问:我想实现这样的效果,图片由下往上移动,每移动n张图片就停顿m秒,当鼠标移到图片上时,图片移动停止,移开时图片继续循环移动。寻求代码,多谢高手!!
...全文
57 4 点赞 打赏 收藏 举报
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
tzj 2004-04-30
忘啦说啦,先要把它下载下来哦.
---------------------------------------
----------->
  • 打赏
  • 举报
回复
tzj 2004-04-30
建议在网上找找这样的网站,用Macromedia Dreamweaver MX打开,看人家是怎么写的.不就啦.
我是这样学的,不错呀.
  • 打赏
  • 举报
回复
beyondhai 2004-04-30
多谢高手,但怎么才能实现当鼠标指向时就停止移动,移开时继续移动?谢谢!!!
  • 打赏
  • 举报
回复
ghlfllz 2004-04-30
<html>
<head>
<title>Scroll Images</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="Layer1" style="position:absolute; left:0px; top:0px; width:313px; height:438px; clip:rect(0 313 438 0); z-index:1; border: 0px none #000000">
<div id="Layer2" style="position:absolute; left:0px; top:0px; width:313px; height:438px; z-index:1; border: 0px none #000000;visibility:visible;">
<table cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="#d4be92">
<tr>
<td align="center" height="146">
<img src="images/index_frame_1.gif">
</td>
</tr>
<tr>
<td align="center" height="146">
<img src="images/index_frame_2.gif">
</td>
</tr>
<tr>
<td align="center" height="146">
<img src="images/index_frame_3.jpg">
</td>
</tr>
</table>
</div>
<div id="Layer3" style="position:absolute; left:0px; top:438px; width:313px; height:438px; z-index:1; border: 0px none #000000;visibility:visible;">
<table cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="#d4be92">
<tr>
<td align="center" height="146">
<img src="images/index_frame_4.jpg">
</td>
</tr>
<tr>
<td align="center" height="146">
<img src="images/index_frame_5.jpg">
</td>
</tr>
<tr>
<td align="center" height="146">
<img src="images/index_frame_6.jpg">
</td>
</tr>
</table>
</div>
</div>
<script language="vbscript">
<!--
dim layer_top(2) '图层的上边距
layer_top(1)=0
layer_top(2)=438
settimeout "scroll_layer",2000 '延时2秒后滚动图层

sub scroll_layer() '滚动图层
layer2.style.top=layer_top(1)-1 '每次向上滚动1个象素
layer_top(1)=layer_top(1)-1
layer3.style.top=layer_top(2)-1
layer_top(2)=layer_top(2)-1
if layer_top(2)<>0 and layer_top(1)<>0 then
settimeout "scroll_layer",5 '每5毫秒滚动一次
else
change_disp '改变图层的显示方式
end if
end sub

sub change_disp() '改变图层的显示方式
dim top_value_tmp '临时存储图层TOP值
dim value_top_2,value_top_3 'layer2,layer3的最终top数值
top_value_tmp=layer2.style.top
value_top_2=split_layer_top(top_value_tmp) '解析top值
top_value_tmp=layer3.style.top
value_top_3=split_layer_top(top_value_tmp) '解析top值
if value_top_3<value_top_2 then
move_layer3 '移动图层3
else
move_layer2 '移动图层2
end if
settimeout "scroll_layer",2000 '延时2秒后滚动图层
end sub

sub move_layer2() '移动图层2
layer2.style.visibility="hidden"
layer2.style.top="438px"
layer_top(1)=438
layer2.style.visibility="visible"
end sub

sub move_layer3() '移动图层3
layer3.style.visibility="hidden"
layer3.style.top="438px"
layer_top(2)=438
layer3.style.visibility="visible"
end sub

function split_layer_top(top_value) '解析层的top值取得它的相应数值
dim tmp_value
tmp_value=left(top_value,len(top_value)-2)
split_layer_top=cint(tmp_value)
end function
-->
</script>
</body>
</html>
  • 打赏
  • 举报
回复
相关推荐
发帖
JavaScript
加入

8.5w+

社区成员

Web 开发 JavaScript
申请成为版主
帖子事件
创建了帖子
2004-04-30 10:57
社区公告
暂无公告