before formating my computer I had a nice javascript for image rollover, but the folder on my back-up dvd isn;t accesble, others are, but the folder with all my website stuff is lost (some others too,,,) now I found a script that does allmost the same:
only it doesn't work with multiple images, anyone knows a better script? or want to help me?? I just need one where I add a id or name to an image and the it will show the same image name only with something afther it (above example is _omo ie so home.gif and home_omo.gif)
I searched alot with google, but I only find with css or a javascript were I manualy need to add all images.
hope someone can help me,,, please
| Code: |
| var W3CDOM = (document.createElement && document.getElementsByTagName);
var mouseOvers = new Array(); var mouseOuts = new Array(); window.onload = init; function init() { if (!W3CDOM) return; var nav = document.getElementById('mouseovers'); var imgs = nav.getElementsByTagName('img'); for (var i=0;i<imgs.length;i++) { imgs[i].onmouseover = mouseGoesOver; imgs[i].onmouseout = mouseGoesOut; var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.')); mouseOuts[i] = new Image(); mouseOuts[i].src = imgs[i].src; mouseOvers[i] = new Image(); mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_omo" + suffix; imgs[i].number = i; } } function mouseGoesOver() { this.src = mouseOvers[this.number].src; } function mouseGoesOut() { this.src = mouseOuts[this.number].src; } |
only it doesn't work with multiple images, anyone knows a better script? or want to help me?? I just need one where I add a id or name to an image and the it will show the same image name only with something afther it (above example is _omo ie so home.gif and home_omo.gif)
I searched alot with google, but I only find with css or a javascript were I manualy need to add all images.
hope someone can help me,,, please
