McBryver Posted September 11, 2010 Share Posted September 11, 2010 Ok all sites on google says this should work but it dosnt. Javascript: <head> <script type="text/javascript"> function preloader() { fresh = new Image(960,720) fresh.src = "http://x-tremeclean.com/images/fresh.png" } </script> </head> <body id="top" onLoad="javascript:preloader()"> Image Code: <div class="floater"> <h2>1. This carpet is the after picture of what we have done.</h2> <p>This is what we accomplish using our RX-20 Cleaning Device.</p> </div> <p class="readmore"><a href="#">Schedual Quote »</a></p> <img src="images/fresh.png" id="fresh" name="fresh" alt="" /> </div> Any help would be cool. McBryver Quote Link to comment Share on other sites More sharing options...
McBryver Posted September 11, 2010 Author Share Posted September 11, 2010 Sorry guys the image didnt upload properly so I uploaded it again and it worked all tho it does not load pre-load. It loads after the rest of the page. Any help on making it load b4 the page loads let me know, Thanks Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted September 12, 2010 Share Posted September 12, 2010 That is because you are calling the function on page load,after everything else has loaded. Try this... <script type="text/javascript"> <!-- fresh = new Image(960,720) fresh.src = "http://x-tremeclean.com/images/fresh.png" //--> </script> Instead of... <script type="text/javascript"> function preloader() { fresh = new Image(960,720) fresh.src = "http://x-tremeclean.com/images/fresh.png" } </script> Regards, Paul. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.