...

View Full Version : Javascript menus failing?



dragonusthei
05-11-2007, 09:39 PM
Hello,

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
Ashley

cyberlogi
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.

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

dragonusthei
05-13-2007, 07:45 PM
Hi,

How would i make ie cache the images?

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

rwedge
05-14-2007, 03:15 PM
You could try:
<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>

cyberlogi
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