We help IT Professionals succeed at work.

JavaScript for image hover not working in FIREFOX BROWSER

mdkshah786
mdkshah786 asked
on
409 Views
Last Modified: 2012-06-21
Hello Experts !

I'm working on an enhancement in my ASP.NET 4.0 web project.

Previously, I have a column present in GridView which holds the URL LINK of different images. When the user clicks this URL LINK he gets redirected to another page with the display of respective image.

Now, in the enhancement, when the user clicks the URL LINK, he must gets the display of page image at the center of the same page only.

I have written code which is working perfectly fine for IE & CHROME browser but its not at all working fine with FIREFOX browser.

Some Part of Code in ASPX Page :
<script type="text/javascript">
        // define reference to the hidden div element
        var div;
        // set reference to the div element after page is loaded
        function hover_show(src)
		{
            div = document.getElementById('hoverbox');
             div.innerHTML = '<img src="' + src + '" width="80%" height="80%" scrolling="no" />';
            div.style.visibility = 'visible';

        }
        function hover_hide()
		{
            div.style.visibility = 'hidden';
        }
    </script>

Open in new window

In Code File :
if (e.Row.Cells[21].Text != "&nbsp;" && e.Row.Cells[21].Text != "0")
{
	//e.Row.Cells[21].Text = String.Format("<a href=" + e.Row.Cells[21].Text + " target='_blank'>View Image</a>"); //Image URL
	e.Row.Cells[21].Attributes.Add("onmouseover", "hover_show('" + e.Row.Cells[21].Text + "')");
	e.Row.Cells[21].Attributes.Add("onmouseout", "hover_hide()");
	e.Row.Cells[21].Text = String.Format("<a class='imgLink' href='#' name=" + e.Row.Cells[21].Text + " style='cursor:hand' >View Image</a>"); //Image URL

}
else
{
	e.Row.Cells[21].Text = "";
}

Open in new window

Please anyone help me on this !
Regards...
Comment
Watch Question

CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*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.