I  D:

PW:

    

·电话:025-84664270
·电话:025-84664470
·全国:400-8198-518
·Q  Q:368369556
·Q  Q:5813429
·MSN:xunlingsales@
hotmail.com






 
 

·网页设计制作搜索

 
 

首页 >> 网页设计特效:公告栏的滚动图片

 

 

网页设计特效:公告栏的滚动图片

 
 

以下是代码片段:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效|Linkweb.cn/Js|---公告栏的滚动图片</title>
</head>

<body>
 

<script language="JavaScript1.2">
var scrollerwidth=232; var scrollerheight=94; var scrollerbgcolor='white'; var pausebetweenimages=3000; var slideimages=new Array()
slideimages[0]='<a href="#"><img src="images/flag.gif" alt="精彩哦" border=0"></a>'; slideimages[1]='<a href="#"><img src="images/developer.gif" alt="好看哦" border=0"></a>'; slideimages[2]='<a href="#"><img src="images/shu.gif" alt="好看哦" border=0"></a>';

if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(second2)",pausebetweenimages)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(first2)",pausebetweenimages)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}}
window.onload=startscroll
//-->
</script> <ilayer id="main" width="&{scrollerwidth};" height="&{scrollerheight};" bgcolor="&{scrollerbgcolor};"> <layer id="first" left="0" top="1" width="&{scrollerwidth};"> <script
language="JavaScript1.2">
if (document.layers)
document.write(slideimages[0])
  </script> </layer> <layer id="second" left="0" top="0" width="&{scrollerwidth};" visibility="hide"> <script language="JavaScript1.2">
if (document.layers)
document.write(slideimages[1])
  </script> </layer> </ilayer>
<p> </p>
<p><script language="JavaScript1.2">
<!--
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}

//--></script>

</body>

</html>

【来源:本地】【加入时间:2007-3-7 17:36:08】【浏览:次】【关闭窗口

 

上一条:网页制作特效:双击可放大缩小的图片 / 下一条:网页制作特效:屏幕上自由飘浮的图像
 

推荐资讯

 

最新文章

· 动画设计公司网站设计案例 2007-10-19 [广告装潢]
· JS获取网页中HTML元素的几种方法 2008-1-14 [案例欣赏]
· 图形界面、数字色彩的一些词语中英文对照 2008-1-14 [案例欣赏]
· 800分辨率下网站如何搭配才可以提高体验度 2008-1-10 [网页制作]
· 注册登录界面设计的八种错误表现 2008-1-10 [网页制作]

关于《 网页设计特效:公告栏的滚动图片 》的申明:
·若非特别说明,本文则为本站原创,转载请注明出处"讯领中国",并带上链接:http://www.cxne.com.cn
·本站提供的案例欣赏,并非全部为本公司作品,仅作为比较和报价参考。
·本站内容如果侵犯了您的权利,请与我们联系:025-84664270。我们尊重作者的知识产权和其他保留权利。


 

 
 

 

首页关于我们服务项目技术文库网站案例  | 营销中心友情链接网站地图联系方式

 
 

讯领中国 ®  版权所有 苏ICP备06012455号  地址:南京珠江路675号408