Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript menus failing?

    Hello,

    On my site Dog Toys I use a Javascript drop down menu. However some of the time the menu works fine until you roll over the drop down list and the background no longer changes coulor as it should. When it does this the links take agers to load when clicked. It seems like some kind of lag/loading problem. Could some one please take a look as im really stuck!

    Just to add it only ever does it on internet explorer never firefox.

    Thank you
    Ashley

  • #2
    New Coder
    Join Date
    Apr 2007
    Location
    Silicon Valley California
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Most likely you don't have your server setup to cache images. IE 6 and lower don't cache images by default so every time you change the background image using JavaScript it will re-request and download the same image. I had an application with hover styles over row elements and as I moved my mouse, I watched IE download thousands of duplicate images. This would slow my application to a crawl.

    Here is a tool that will help you sniff your http requests in IE.

    http://www.fiddlertool.com/fiddler/

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    How would i make ie cache the images?

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    please any one?

  • #5
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    You could try:
    Code:
    <script type="text/javascript">
    /*<![CDATA[*/
    if (document.images) {
    pic1= new Image(); 
    pic1.src="image1.gif"; 
    pic2= new Image(); 
    pic2.src="image2.gif"; 
    pic3= new Image(); 
    pic3.src="image3.gif"; 
    }
    /*]]>*/
    </script>

  • #6
    New Coder
    Join Date
    Apr 2007
    Location
    Silicon Valley California
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The above is one solution.

    A better might be to cache the images using your web servers native technology (if possible). I don't know what server technology you are using, but you should ask on a forum board about your server how to cache files image.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •