Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:55

Initial delay in displaying background image

Poster: nige_w
Dated: Friday January 28 2005 - 3:31:31 GMT

We ( are new users of the Milonic Navigation for websites we create. All the designers here love it !

We have recently created a new site ( using a background image for the navigation.

We have noticed that there is a slight delay in displaying the over background image when first mousing over the navigation items.

We attempted re-loading the image to see if this would correct the problem, however this has not helped.

Can you advise if there is something we are doing wrong / could be doing better when using background images for the navigation.


Poster: Ruth
Dated: Friday January 28 2005 - 5:09:34 GMT

There is a preloadmenuimages.js module that might help. It's the 'over' images loading. I watched the status bar and they are there if you wait for the images to load. But if you mouseover right away then the image isn't load yet and that's causing the problem.

I don't know if this would make a difference but there is also a buildAllMenusproperty. It's down a few items. I don't know if that would help here since you don't have any submenus.


Re: Initial delay in displaying background image

Poster: kevin3442
Dated: Friday January 28 2005 - 5:18:24 GMT


nige_w wrote:
We have noticed that there is a slight delay in displaying the over background image when first mousing over the navigation items.

It's probably the time it takes to download the background image the first time it is used (so it isn't in the browser's cache yet). You don't notice a delay after that because the image is now loaded from the cache. Two suggestions:

(1) Normally, to cut down on processing time when the page loads, a menu isn't "built" until it is first opened. You can cause the system to build all menus when the page loads by placing buildAllMenus = true; at the top of your menu_data.js file, with the other global variables (where you see _menuCloseDelay=500 etc.). Honestly, it's been a while since I've used that, but I'm thinking that it may load the images while it's building the menus. If that's the case, then the image should already be in the cache the first time it's needed.

If that doesn't work:

(2) well... I just did a search for preloadmenuimages.js to find a link to a topic mentioning it, and the top of the results page showed this thread! "Now how could that be???" I thought. Turns out it's because Ruth posted a reply while I was typing this one. A day late and a dollar short... again.

If you try the preloader, make sure you load the preloadmenuimages.js file after your menu_data.js file.



Poster: nige_w
Dated: Friday January 28 2005 - 18:04:23 GMT

Hi Ruth and Kevin

Thanks for your replies - I will investigate when I'm back at work next week.

I did notice a typo in my first post - I meant to say that we are preloading the over state image - my post said we were re-loading - oops.

Thanks againf ro your help.



Poster: nige_w
Dated: Sunday January 30 2005 - 23:36:37 GMT

I've just re-read my comments and realise my typing skills haven't been to flash !!!

In any case I have tried the following with no success :

1. Manually inserting JavaScript to preload the overbgimage.
2. Using the preloadmenuimages.js file to preload the image.
3. Using the buildAllMenus = true; variable.

We have a MySQL database driven content management system so we do not use the "menu_data.js" file - this is all built dynamically as the page loads. We have however factored in the ability to add the "buildAllMenus = true;" variable.

The weird thing is that another site we have created also uses background images for the nav and there is absolutely no delay in loading the over state. This site does have a simple JavaScript preloader loaded within the site.

The exmaple sites are

1 - - delay in rollover image
2 - - no delay

Poster: nige_w
Dated: Monday January 31 2005 - 0:59:58 GMT

OK folks - false alarm - ignore the idiot from down under . . .

I have reinserted the JavaScript code to preload the image (this is hand coded as opposed to the Milonic preloader) and everything is now working fine.

Sorry for the disturbance, but thanks for your input.