View Full Version : Javascript menus failing?

05-11-2007, 09:39 PM

On my site Dog Toys (http://www.dog-toy.co.uk/) 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

05-12-2007, 01:12 AM
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.


05-13-2007, 07:45 PM

How would i make ie cache the images?

05-14-2007, 02:52 PM
please any one?

05-14-2007, 03:15 PM
You could try:
<script type="text/javascript">
if (document.images) {
pic1= new Image();
pic2= new Image();
pic3= new Image();

05-24-2007, 10:59 PM
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.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum