当前位置:编程学习 > JS >>

用javascript实现图片马赛克后显示并切换

答案:<script language="JavaScript1.1">
var slidespeed=3000
//specify images
var slideimages=new Array("/upload/20121013/2482150_1_7.jpg","http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_2_1.jpg","http://www.blueidea.com/articleimg/upload/2006/3/5/2482150_3_2.jpg")
//specify corresponding links
var slidelinks=new Array("#","#","#")
var imageholder=new Array()
var ie55=window.createPopup
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}
function gotoshow(){
window.location=slidelinks[whichlink]
}
//-->
</script>
<a href=><script language="JavaScript1.1">
<!--
var whichlink=0
var whichimage=0
var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie55) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie55) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+pixeldelay)
}
slideit()
//-->
</script>

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

上一个:javascript跟随鼠标x,y坐标移动的字效果
下一个:用javascript将数据库中的TEXT类型数据动态赋值到TEXTAREA中

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,