Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i had used jquery for hover image to display on another page but it work in IE but it not work in firefox please helpp its urgent thank a lot...
Posted
Comments
Ali Al Omairi(Abu AlHassan) 15-Sep-11 10:43am    
would you please give us the code?!
bhargavpp 16-Sep-11 3:19am    
jQuery("img.views2").mouseover(function (e)
{
b2 = jQuery(".bigimag").attr('src');

c2 = jQuery(this).attr("src");

jQuery(".bigimag").attr("src", c2);
});
jQuery("img.views2").mouseleave(function (e)
{
jQuery(".bigimag").attr("src", b2);
});

this is the code that i used for image hover it work in ie not in firefox and also one jquery.js is uesd
Ali Al Omairi(Abu AlHassan) 16-Sep-11 14:36pm    
i think, this happens because you are using the variables c2 and b2 as implit global variales.
Try to delare them explicetly.
Sunasara Imdadhusen 16-Sep-11 1:05am    
Please provide snippet of code!
bhargavpp 16-Sep-11 3:18am    
jQuery("img.views2").mouseover(function (e)
{
b2 = jQuery(".bigimag").attr('src');

c2 = jQuery(this).attr("src");

jQuery(".bigimag").attr("src", c2);
});
jQuery("img.views2").mouseleave(function (e)
{
jQuery(".bigimag").attr("src", b2);
});

this is the code that i used for image hover it work in ie not in firefox and also one jquery.js is uesd

Hi,

Try this code for your requirement ...

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language ="javascript" >
        function f3() {
            $("#smimg").hover(function () {
                $("#bigimg").attr('src', this.src);
                $("#bigimg").show();
            }, function () {


            });
        }
     
        function openbigimg(imgname) {
            document.getElementById("bigimg").src = "../images/"+imgname;
            document.getElementById("bigimg").style.display = "";
        }
        function closebigimg(imgname) {
            document.getElementById("bigimg").style.display = "none";
        }
    </script>
</head>
<body onload ="f3()" >
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
    </asp:scriptmanager>
 
      <br />
    <img id="smimg" src="../images/Sunset.jpg" width="50" height="50" onmouseenter="openbigimg('Sunset.jpg')" onmouseout="closebigimg('Sunset.jpg')" />
    <img id="bigimg" src="../images/Sunset.jpg" width="300" height="300" style=" position :fixed; left :150px; top:150px; display:none;" />
    </form>
</body>
</html>


I hope it works for you also.

If it works you've to change some little bit for your application


All the best
 
Share this answer
 
Comments
bhargavpp 17-Sep-11 6:03am    
solved by my own method
Resolved.. by my own logic so no need to worry
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900