Let me get this straight. The script already has an image and a link that clicking on it will take you to. All you want to do is add a hover effect to change each given image to a different one, right? Hmm, if so, looking at it I think you would also want it to pause while the mouse is over it, otherwise things could get messy. Pausing while the mouse is over it is a good idea even without the hover effect because otherwise a link might change before the person is able to click on it. And with the hover effect, it would be even more important. If that's what you want, and you agree about the pause, this seems to work (though I may refine it):
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
img[name='slide'] {
vertical-align: middle;
}
</style>
<script type="text/javascript">
//preload images
var image1 = new Image();
image1.src = "http://www.jr-richscooterdoc.com/Vbanlogo/RapidJim.png";
var image2 = new Image();
image2.src = "http://www.jr-richscooterdoc.com/Vbanlogo/Abscoot.jpg";
var image3 = new Image();
image3.src = "http://www.jr-richscooterdoc.com/Vbanlogo/MegM2.jpg";
var image4 = new Image();
image4.src = "http://www.jr-richscooterdoc.com/Vbanlogo/valleyS.jpg";
var image5 = new Image();
image5.src = "http://www.jr-richscooterdoc.com/Vbanlogo/buggyP.jpg";
var image6 = new Image();
image6.src = "http://www.jr-richscooterdoc.com/Vbanlogo/SCOOTERCHROMEPARTS.png";
var image7 = new Image();
image7.src = "http://www.jr-richscooterdoc.com/Vbanlogo/scrappydog.jpg";
var image8 = new Image();
image8.src = "http://www.jr-richscooterdoc.com/Vbanlogo/Bintelli.jpg";
var image9 = new Image();
image9.src = "http://www.jr-richscooterdoc.com/Vbanlogo/TVnAC.png";
var image10 = new Image();
image10.src = "http://www.jr-richscooterdoc.com/Vbanlogo/PFS.jpg";
var numimgs = 0;
while(window['image' + (++numimgs)]){}
--numimgs;
</script>
</head>
<body>
<p align="center">
<button onclick="clearTimeout(slideit.timer); step = whichlink || numimgs; slideit();">PREV</button>
<a href="javascript:slidelink()">
<img src="http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif" name="slide" border="1" width="600" height="100" position="center" /></a>
<button onclick="clearTimeout(slideit.timer); slideit();">NEXT</button>
</p>
<script type="text/javascript">
var step = 1;
var whichlink = 0;
function slideit(){
if (!document.images){return;}
document.images.slide.src = window['image' + step].src;
whichlink = step - 1;
step = (++step) % numimgs || numimgs;
slideit.timer = setTimeout(slideit, 8000);
}
slideit();
function slidelink(){
window.location = [
/* 1 */ "http://www.rapidrepairpowersports.com/",
/* 2 */ "http://www.absolutelyscooterparts.net",
/* 3 */ "http://www.megamotormadness.com/",
/* 4 */ "http://www.scootersus.com",
/* 5 */ "http://www.buggypartsnw.com",
/* 6 */ "http://scooterchromeparts.com",
/* 7 */ "http://www.scrappydogscooters.com/Home_Page.php",
/* 8 */ "http://www.bintelli.com/",
/* 9 */ "http://www.testedscooterparts.com/",
/* 10 */ "http://www.partsforscooters.com/"
][whichlink];
}
function slidehover(){
clearTimeout(slideit.timer);
slidehover.im = document.images.slide.src;
document.images.slide.src = [
/* 1 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 2 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 3 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 4 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 5 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 6 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 7 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 8 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 9 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif",
/* 10 */ "http://i499.photobucket.com/albums/rr359/jrryan2008/Scoot%20Prof/rapid_repair-1.gif"
][whichlink];
}
function slideout(){
document.images.slide.src = slidehover.im;
slideit.timer = setTimeout(function(){slideit();}, 4000);
}
document.images.slide.onmouseover = slidehover;
document.images.slide.onmouseout = slideout;
</script>
<!-- /Scroller Ad Code -->
</body>
</html>
Notice the highlighted image list near the end inside the slidehover() function. Since I only had one extra banner sized image handy to play with, I made them all the same. If I understand what you are going for, you would make each of these different and they would each be for the same site as the non-hover image. For example, /* 4 */ would be an alternate image for scootersus.com and /* 5 */ would be one for buggypartsnw.com, and so on.
Any questions, just let me know.
Bookmarks