View Full Version : JS Rollover Problem (works in IE, not in FF) [SOLVED]

01-13-2007, 04:43 AM
I'm working with a friend on a rather large project. He's doing the graphical work and I'm doing the coding, and I've reached a problem with a rather small JavaScript snippet I wrote. The purpose is going to be (eventually) that the user can hover their mouse over any of four big images on the homepage and text will be displayed on the image, then that text will disappear when the user's mouse leaves the image. Half of the battle is done as far as I'm concerned. My code works just how I want it to in IE7.. but upon viewing the same page in FireFox 2.0, the JavaScript has no effect.

Here is the page with the problem: http://healthropes.snsoftware.net/files/alpha/index.htm.

All of the JavaScript is located in that index page. I am rather new to JavaScript and I used a few tutorials to help me set up what I have now. Basically, all I need to happen at the moment is for the page linked to above to work in FireFox exactly as it does in Internet Explorer.

Any help with this problem would be GREATLY appreciated!


EDIT: PROBLEM SOLVED - Thanks, TripperTreats :)

01-13-2007, 06:50 AM
change document.all to document.getElementById

01-13-2007, 06:52 AM
I meant to show the new function:

function ro_show(div) {
var obj = document.getElementById('rollover_'+div);
obj.innerHTML = hovertext[div];

01-13-2007, 05:35 PM
Wow, thanks! I *knew* it had to be something like that .. something I'd never detect :P. Thank you very much, after making the same adjustment to the other function, things are working perfectly!

Thanks again,