I want it so that when you move the mouse over the picture, another one is displayed, not the next one. For example, I have this picture of an empty room. I editted it in photoshop and made it look totally different. I want it so that in lightbox, the empty room is shown, but when you mouse over, not click, that image, the editted room is shown.
I haven't used or tried lightbox so I can't tell you if there's an easier way to implement this, but I wrote you up a short tut on how you could do this...
First you need to put this piece of JavaScript in <head> of your page:
Code:
<script type="text/javascript">
function omo(img,iid){
var dir = "somedir/images/";
document.getElementById(iid).src = dir+img;
}
</script>
What that does is select your element with specific id (in this case would be <img> tag with specified id) and replaces it's src attribut, e.g. changes the images when it's called. How it's called I'll exapain a bit later.
In the function you need to change variable
dir to point to directory with your images.
The function itself needs 2 values passed to it, first is the name of the image (e.g. my_pic.jpg) and the second id attribute of your <img> tag.
The best way to use it would be to place an image inside <a> (you don't have to put href if you don't need linking) with onmouseover and onmouseout actions. For example:
HTML:
<a onmouseover="javascript:omo('pic_on.jpg','myimage');" onmouseout="javascript:omo('pic_off.jpg','myimage');"><img src="somedir/images/pic_off.jpg" id="myimage" /></a>
In
onmouseover="javascript
mo('pic_on.jpg','myimage');" it's defined what image will be loaded when mouse is over it and what is the ID of the element in which it should be placed (so you need to give IDs to all your <img> for which you want this effect to work).
onmouseout="javascript
mo('pic_off.jpg','myimage'); defines what image will be loaded when the mouse itsn't hovering above it anymore.
There you go. I hope it helps and that you suceed in implement it as you like. And let me know if it works out
