I am so new to javascript that the following is the first script that I have ever written myself (that I didn't just copy/paste from someone else).
Not surprisingly I cant get it to work. Can anyone offer some suggestions?
The idea here is that I have a table full of thumbnails that when hovered load a new image in another box beside the thumbnails (called photobox).
Code:<script type="text/javascript"> var photobox; function loadImageInPhotobox() { var id = thumb.id; var filename="images/" + id + "_full.jpg"; photobox.style.background="url(" + filename + ")"; } function init() { photobox=document.getElementById("photobox"); var thumb = document.getElementByClass("thumbnail"); thumb.onmouseover=loadImageInPhotobox(); } onload=init; </script>


Reply With Quote

Bookmarks