新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 网页设计 > Css教程 > 正文:revealTrans滤镜制作超弦图片的播放

revealTrans滤镜制作超弦图片的播放

新客网 XKER.COM 2007-11-08 来源:新客网搜集整理 收藏本文
     CSS中有revealTrans滤镜在网页中制作特效非常有用处。这次,我们准备介绍另一种使用revealTrans滤镜制作出超弦图片播放的效果。

  实现思路:使用revealTrans滤镜制作出超弦图片播放的效果,并每张图片有各自的链接地址。

  制作方法:

  1、在<head>中插入JS代码:

以下是引用片段:
<SCRIPT language=JavaScript1.2>
function reapply(){
setTimeout("slideit()",800)
return true
}
window.onerror=reapply
</SCRIPT>
<SCRIPT language=JavaScript1.1>
<!--
//preload images
var image1=new Image()
image1.src=图片地址"
var image2=new Image()
image2.src=图片地址"
var image3=new Image()
image3.src=图片地址"
var image4=new Image()
image4.src=图片地址"
var image5=new Image()
image5.src=图片地址"
var image6=new Image()
image6.src=图片地址"
var image7=new Image()
image7.src=图片地址"
var image8=new Image()
image8.src=图片地址"
var image9=new Image()
image9.src=图片地址"
//-->
</SCRIPT>

  其中:images/图片地址为显示图片的路径,可按实际情况修改。

  2、在<body>中插入代码:onload=slideit()

  3、在页面中插入图片。

     
并在图片<img>中插入:style="FILTER: revealTrans(Duration=2, Transition=23)",并命名为:name=slide
  完整代码:<img src=连接地址"images/图片地址" width="120" height="90" border="0" style="FILTER: revealTrans(Duration=2, Transition=23)" name=slide>

  4、给图片加超链接:<a href="JavaScript:slidelink()">

  5、加入代码:
以下是引用片段:
<SCRIPT>
<!--
////change number of images below 
var number_of_images=9
//change speed below (in seconds)
var speed=3
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
if (document.all)
slide.filters.item(0).Apply()
document.images.slide.src=eval("image"+step+".src")
if (document.all)
slide.filters.item(0).Play()
whichimage=step
if (step<number_of_images)
step++
else
step=1
if (document.all)
setTimeout("slideit()",speed*1000+3000)
else
setTimeout("slideit()",speed*1000)
}
function slidelink(){
if (whichimage==1)
top.location.href=图片地址"/index.HTML"
if (whichimage==2)
top.location.href=图片地址"/news.HTML" 
if (whichimage==3)
top.location.href=图片地址"/game.HTML" 
if (whichimage==4)
top.location.href=图片地址"/music.HTML" 
if (whichimage==5)
top.location.href=图片地址"/sport.HTML" 
if (whichimage==6)
top.location.href=图片地址"/radio.HTML" 
if (whichimage==7)
top.location.href=图片地址"/travel.HTML" 
if (whichimage==8)
top.location.href=图片地址"/card.JSP" 
else if (whichimage==9)
top.location.href=图片地址"/study.HTML" 
}
</SCRIPT>

  其中:各链接地址相对应<head>中插入的JS代码中的图片。

  注意,页面地址必须与图片张数相对应。
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐