Академический Документы
Профессиональный Документы
Культура Документы
<head>
<TITLE>ImageSlider 2.0: </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
// CREDITS:
// ImageSlider 2.0
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains
as is.
// Additional scripts can be found at http://www.24fun.ch.
// info@24fun.ch
// 2/8/2000
// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a link to http://www.24fun.ch on the webpage
// CONFIGURATION:
// The trick of this script is a very long (1800 pixels)
// and very thin (17 pixels) gif-image. In this sample the gif-image is
// called 'imgcover1800px.gif'.
// This gif-image consists of two colors: black and white stripes.
// The black strips are transparent.
// By wiping this gif-image back and forth over your
// pictures you get the illusion of a fade-in-fade-out-effect.
// Try new effects by crating new gif-images!
// the name of the gif-image gliding over your pictures back and forth
var coverimage="imgcover1800px.gif"
// the width of the gif-image gliding over your pictures back and forth
var coverimagewidth=1800
// the height of the gif-image gliding over your pictures back and forth
var coverimageheight=17
// influences the speed of the effect. A high value will slow it down
var speed=20
// standstill (microseconds)
var pause=1500
function fadeout() {
if (document.all) {
if (document.all.cover.style.posLeft >=(-
coverimagewidth+imagewidth+coverimageleft+step)) {
clipleft+=step
clipright=clipleft+imagewidth
clippoints="rect("+cliptop+" "+clipright+" "+clipbottom+"
"+clipleft+")"
document.all.cover.style.clip=clippoints
document.all.cover.style.posLeft-=step
timer= setTimeout("fadeout()",speed)
}
else {
clearTimeout(timer)
i_image++
if (firsttime) {i_image--;firsttime=false}
if (i_image>=image.length) {i_image=0}
text.innerHTML=image[i_image]
thisurl=imageurl[i_image]
timer= setTimeout("fadein()",pause)
}
}
if (document.layers) {
if (document.cover.left >=(-
coverimagewidth+imagewidth+coverimageleft+step-22)) {
clipleft+=step
clipright=clipleft+imagewidth
document.cover.clip.top=cliptop
document.cover.clip.left=clipleft
document.cover.clip.bottom=clipbottom
document.cover.clip.right=clipright
document.cover.left-=step
timer= setTimeout("fadeout()",speed)
}
else {
clearTimeout(timer)
i_image++
if (firsttime) {i_image--;firsttime=false}
if (i_image>=image.length) {i_image=0}
document.text.document.write(image[i_image])
document.text.document.close()
thisurl=imageurl[i_image]
timer= setTimeout("fadein()",pause)
}
}
}
function fadein() {
if (document.layers) {
if (document.cover.left<=coverimageleft) {
clipleft-=step
clipright=clipleft+imagewidth
document.cover.clip.top=cliptop
document.cover.clip.left=clipleft
document.cover.clip.bottom=clipbottom
document.cover.clip.right=clipright
document.cover.left+=step
timer= setTimeout("fadein()",speed)
}
else {
clearTimeout(timer)
timer= setTimeout("init()",pause)
}
}
if (document.all) {
if (document.all.cover.style.posLeft<=coverimageleft) {
clipleft-=step
clipright=clipleft+imagewidth
clippoints="rect("+cliptop+" "+clipright+" "+clipbottom+"
"+clipleft+")"
document.all.cover.style.clip=clippoints
document.all.cover.style.posLeft+=step
timer= setTimeout("fadein()",speed)
}
else {
clearTimeout(timer)
timer= setTimeout("init()",pause)
}
}
}
function gotourl() {
document.location.href=thisurl
}
<style type="text/css">
.imagestyle {
position:absolute;
left:-5000px;
}
</STYLE>
</HEAD>
<BODY bgcolor=FFFFFF style="width:100%;overflow-x:hidden;overflow-
y:scroll" onLoad="init()">
<DIV style="position:absolute;top:145px;left:10px;">
<font size=1 face=Verdana><ul><b>ImageSlider 2.0: new fade-in-fade-out
for your images</b>
</DIV>
</BODY>
</HTML>