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:33

Bug Fix for 5.775 - AJAX (with slow load and quick rolls)


Poster: webdevil
Dated: Sunday June 24 2007 - 4:26:17 BST

I dont know how to officially submit a bug, but found that when using a slower loading ajax version of the submenus (using your demo as a model). It can throw an error when moving mouse too quickly over items and off again (only certain items without a submenu usually next to an item with one, roll back and forth quickly between the two, before the AJAX call loaded the one with a sub). After this error throws, the menus go out of wack and can only be repaired by page load (not self healing).

The error thrown is something like...
$c("simg"+i) is not an object

Not sure at all what it does but i found two places (simple "find" command for the pattern) where the code (mmenudom) sets a .src property equal to something. looks like this...

$c("simg"+i).src=I[48];

and again later in the script like this...

$c("simg"+i).src=I[24];

Now i got around it by simply adding an "exists" check (if{}) around them like this...

if($c("simg"+i)){$c("simg"+i).src=I[48];}

and like this...

if($c("simg"+i)){$c("simg"+i).src=I[24];}

It seems to work fine. I roll on/off very quickly, really trying to bust it (firebug debugger). In the places where the error was thrown before, i can see a 1 second hiccup (which was probably the cause before), but now with this in place, the hiccup just passes harmlessly and all loads are normal. (now self healing)

Take this for whatever it is (and whatever magic you work to make an official fix), i am sure on the next release i will have to watch for an official repair to replace this band-aid.

Thanx.
Webdevil


Poster: webdevil
Dated: Sunday June 24 2007 - 4:34:27 BST

UPDATE:

After playing more and trying to bust my own fix (because i dont like when simple things fix problems)...

If it 'hiccups' like i mentioned in post, it appears to assign the 'submenu' to the item that did not have its own submenu. It still assigns the menu to its original parent, but also to this supposedly childless node also.

I am sure this has something to do with the 'if{ }' check, and it isnt the final solution, but something has to be done to catch the rollovers if they happen faster than AJAX can return the menu... to avoid assigning it to the next item i rollover (it appears to trigger the request as i roll over the parent, but by the time the response comes back i am on the next sibling that is not supposed to have children and it tacks it on there)... maybe something to do with the system checking the 'active' item at the time the request returns (instead of knowing who it should be assigned to at the original call to load)...

I dont know. Unfortunately i found this all while developing localhost and have no examples, but should be easily replicated if you can slow down the response from an AJAX submenu and place it in a menu where the items surronding it do not have their own submenus.

Webdevil


Poster: Ruth
Dated: Sunday June 24 2007 - 10:17:36 BST

Hi,

I'll post this to Milonic.

Ruth


Poster: webdevil
Dated: Sunday June 24 2007 - 14:46:31 BST

thanks.