We help IT Professionals succeed at work.

Firefox Issue

923 Views
Last Modified: 2013-12-07
i want to change image on Onmouseover and OnMouseout event of Img tag it's working fine in IE but it's not showing any onMouseOver/Out event in Firefix, can anyone please help me out in this. here is my code

 <img name="iconclient" id="iconclient" runat="server" src="../images/client1.jpg"
                                    onmouseover='document.getElementById("iconclient").src = "../images/client2.jpg";'
                                    onmouseout='document.getElementById("iconclient").src = "../images/client1.jpg";'
                                    style="cursor: hand; cursor: pointer; border: solid 1px gray; margin-right: 20px;"
                                    align="left" onclick='writeIFrame("placeholder_client", "../Client/ContactDialog.aspx","950","450","no");' />
Comment
Watch Question

Michel PlungjanIT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
Look in the error console to see what could be the reason.

The code does not seem wrong
Michel PlungjanIT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
I would personally write it like this:
<img name="iconclient" id="iconclient"
src="../images/client1.jpg"
onmouseover="document.getElementById('iconclient').src = '../images/client2.jpg'"
onmouseout="document.getElementById('iconclient').src = '../images/client1.jpg'"
style="cursor: hand; cursor: pointer; border: solid 1px gray; margin-right: 20px;"
align="left"
onclick="writeIFrame('placeholder_client', '../Client/ContactDialog.aspx','950','450','no');
return false" />
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Ashutosh VyasIndividual Contributor, Software Architect
CERTIFIED EXPERT

Author

Commented:
thnaks i try with this.src and it worked with IE and FireFox  both.

thanks for the help guys
Ashutosh VyasIndividual Contributor, Software Architect
CERTIFIED EXPERT

Author

Commented:
I am having another problem guys with Firefox, in the onClick of  this image tag I am calling a javascript function "writeIFrame"
// Write out an IFrame
function writeIFrame(placeholder, src, width, height, scroll)
{    var p = placeholder;
    var htmlString = "<iframe src=\""+src+"\" width=\""+width+"\" height=\""+height+"\" scrolling=\""+scroll+"\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" style=\"overflow-x: hidden; overflow-y: auto;\"></iframe>";
    //document.getElementById(p).innerHTML = htmlString;          
    $get(p).innerHTML = htmlString ;
}
which will create an IFrame, problem is that the Main page layer's is overlapping on this IFrame in Firefox and works fine in IE,any help is appreciated.

Thanks in advance.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.