The Little Guy Posted November 28, 2011 Share Posted November 28, 2011 Why doesn't my image load() fire? The image loads, but the function doesn't fire. This part works: $("#main").fadeIn(3000); <script type="text/javascript"> $(window).load(function(){ $("#main").fadeIn(3000); $("img#ximage").load(function(){ $(this).fadeIn("fast"); }); }); </script> <body> <div id="main" style="display: none;"> <div id="X"><img src="/images/x.png" alt="X" id="ximage" style="display: none;" /></div> <p>Some text goes here</p> </div> </body> Link to comment https://forums.phpfreaks.com/topic/251919-fade-in/ Share on other sites More sharing options...
The Little Guy Posted November 28, 2011 Author Share Posted November 28, 2011 Just moved this to the end of the <body> block $("img#ximage").load(function(){ $(this).fadeIn("fast"); }); Link to comment https://forums.phpfreaks.com/topic/251919-fade-in/#findComment-1291692 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.