⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 21.6.htm

📁 使用javascript处理图片特效源码
💻 HTM
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>图像效果</title>
</head>
<body>
<h1>图像显示效果</h1>
<hr>
<script language="JavaScript">
<!--
// the URLs of your images. Add as many images as you like
var imgsname = new Array()
imgsname[0]="3d01.jpg"
imgsname[1]="3d02.jpg"
imgsname[2]="3d04.jpg"

// the the links of your images
var imgsurl = new Array()
imgsurl[0]="http://localhost"
imgsurl[1]="http://localhost"
imgsurl[2]="http://localhost"

// the target of your links. Accepted values: '_blank', '_self', '_top'
// '_parent' or the name of your window
var linktarget="_blank"

// standstill of each image(seconds)
var pause=3

// horizontal position of the slideshow (distance to the left margin of the browser-window, pixels)
var posleft=50

// vertical position of the slideshow (distance to the top margin of the browser-window, pixels)
var postop=100

// // // // // // // // // // // // // // // // // // // // // // // 
// C O N F I G U R A T I O N   E N D S   H E R E
// // // // // // // // // // // // // // // // // // // // // // // 

// do not edit the code below
var contentimage=""
var i_image=0
var i_stepwave=0
var i_maxstepwave=40
var imgpreload=new Array()
for (i=0;i<=imgsname.length-1;i++) {
	imgpreload[i]=new Image()
	imgpreload[i].src=imgsname[i]
}
pause=pause*1000

function initiate() {
      contentimage="<a href='"+imgsurl[i_image]+"' target='"+linktarget+"'><img src='"+imgsname[i_image]+"' border='0'></a>"
    if (document.all) {
		waveimage.innerHTML=contentimage
		waveimage.style.posLeft=posleft
		waveimage.style.posTop=postop
		enlargewave()
    }
    if (document.layers) {
        document.waveimage.left=posleft
		document.waveimage.top=postop
        changeimage()
    }
}

function enlargewave() {
    if (i_stepwave<=i_maxstepwave) {
	    waveimage.filters.wave.phase=i_stepwave
	    waveimage.filters.wave.strength=i_stepwave
        waveimage.filters.wave.lightstrength=i_stepwave
	    waveimage.filters.wave.freq=i_stepwave
        i_stepwave++
	    var timer=setTimeout("enlargewave()",50)
    }
    else {
        clearTimeout(timer)
        changeimage()
    }
}

function reducewave() {
    if (i_stepwave>0) {
	    waveimage.filters.wave.phase=i_stepwave
	    waveimage.filters.wave.strength=i_stepwave
	    waveimage.filters.wave.lightstrength=i_stepwave
	    waveimage.filters.wave.freq=i_stepwave
        i_stepwave--
	    var timer=setTimeout("reducewave()",50)
    }
    else {
        clearTimeout(timer)
        var timer=setTimeout("enlargewave()",pause)
    }
}

function changeimage() { 
    i_image++
    if (i_image>=imgsname.length) {i_image=0}
    contentimage="<a href='"+imgsurl[i_image]+"' target='"+linktarget+"'><img src='"+imgsname[i_image]+"' border='0'></a>"
 
    if (document.all) { 
        waveimage.innerHTML=contentimage
        reducewave()
    }
    
    if (document.layers) {
        document.waveimage.document.write(contentimage)
        document.waveimage.document.close()
        var timer=setTimeout("changeimage()",pause)
    }
    
}

if (document.all) {
	document.write('<DIV ID="waveimage" style="position:absolute; filter:wave();"> </DIV>')
}
if (document.layers) {
	document.write('<LAYER NAME="waveimage"></LAYER>')
	document.close()
}
window.onload=initiate

//-->
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -