I’ve done it before for rollovers but i forget how to preload images. How would i preload this Array? And also, I made a next() function, and you can click Manual Flip which calls the next() and then click autoflip but you cant click autoflip then manual… how can i turn off autoflip when some clicks manual flip?
<html><head><title>Animated Sk8</title>
<script type=”text/javascript” language=”javascript”>
<!– Hide script from old browsers
adImages = new Array(“grind1.gif”,”grind2.gif”,”grind3.gif”,”grind4.gif”,”grind5.gif”,”grind6.gif”,”grind7.gif”,”grind8.gif”,”grind9.gif”,”grind10.gif”,”grind11.gif”,”grind12.gif”,”grind13.gif”,”grind14.gif”,”grind15.gif”)
thisAd = 0
nextAd = 0
imgCt = adImages.length
function rotate() {
if (document.images) {
thisAd++
if (thisAd == imgCt) {
thisAd = 0
}
document.flipBook.src=adImages[thisAd]
setTimeout(“rotate()”, 2 * 100)
}
}
function next() {
nextAd++
if (nextAd == imgCt) {
nextAd = 0
}
document.flipBook.src=adImages[nextAd]
}
// End hiding script from old browsers –>
</script>
<style type=”text/css”>
body {
cursor: crosshair;
}
</style>
</head>
<body bgcolor=”white”>
<img src=”grind1.gif” width=”586″ height=”153″ name=”flipBook” id=”flipBook” alt=”Flip Book!” />
<br />
<button onClick=”rotate()”>Auto Flip</button>
<button onClick=”next()”>Manual Flip</button>
<br />
MADE BY CHRIS ELWELL</body>
</html>