I have a website: http://www.surrealsource.com. If you scroll down the image gallery to an image called "Fractures" and click on it, you'll get an enlarged view of it in the center pane. If you hover your mouse over it, nothing will happen. This is a problem.
I had my code setup so that a different image would show up when the mouse hovers over it, and for a while it worked, but all of a sudden it stopped working.
Here's my code:
in index.html in the image gallery:
in index.html in body (the main viewing pane):Code:<tr><td><a href="#nogo" onclick="changePic(FRACTURES);return false;"><img src="thumbs/fractures.jpg" border=1></a><br>Fractures</td></tr>
in functions.js in changePic() (relevant parts in bold):Code:<div id="picdiv" style="display: none;"> <center> <img id="mainpic" style="border: 3px double darkred;" alt="mainpic" border=1> </center> </div>
Can anybody see why it would have stopped working?Code:function changePic(num) { // change visibility of divs document.getElementById("textdiv").style.display = "none"; document.getElementById("picdiv").style.display = "inline"; document.getElementById("infodiv").style.display = "inline"; // change newer and older links text document.getElementById("nextlink").innerHTML = "NEWER >>"; document.getElementById("prevlink").innerHTML = "<< OLDER"; document.getElementById("print_this_image").style.display = "inline"; // change pic document.getElementById("mainpic").src = "mainpics/"+files[num]; document.getElementById("title").innerHTML = titles[num]; document.getElementById("date").innerHTML = dates[num]; document.getElementById("comment_body").innerHTML = comments[num]; // change printing pic document.getElementById("print_pic").src = "mainpics/"+files[num]; document.getElementById("print_text").innerHTML = titles[num]; cur_pic = num; // figure out if pic is first or last and blot out newer or older link accordingly if (cur_pic == last_pic) { document.getElementById("nextlink").style.display = "none"; } else { document.getElementById("nextlink").style.display = "inline"; } if (cur_pic == first_pic) { document.getElementById("prevlink").style.display = "none"; } else { document.getElementById("prevdiv").style.display = "inline"; } // add special functionalities to Fractures if (cur_pic == FRACTURES) { document.getElementById('mainpic').onmouseover = function(){mainpic.src="mainpics/fractures_odd.jpg";}; document.getElementById('mainpic').onmouseout = function(){mainpic.src="mainpics/fractures_even.jpg";}; document.getElementById('mainpic').setAttribute('usemap', '#fracturesmap', 0); } else { document.getElementById('mainpic').onmouseover = function(){return;}; document.getElementById('mainpic').onmouseout = function(){return;}; document.getElementById('mainpic').removeAttribute('usemap', 0); } }



Reply With Quote



Bookmarks