I'm at work now and was able to compare my customizations to the normal
JDMenu code. Here are the changes I made. First of all, after:
var x = 0, y = 0;
var li = $(ul).parent();
I added this line:
var liTop = li.offset().top;
I also changed this:
ul.$auto = true;
$(ul).css({ width: w - (bl * 2) + 'px',
height: h - (bt * 2) +
'px',
zIndex: '100' });
To this:
ul.$auto = true;
if ($(ul).ancestorsUntil('ul.' +
CSSR).filter('li').size() == 1) {
var ulCSSObj = { width: w - (bl
* 2) + 'px',
height: h - (bt * 2) + 'px',
top: liTop + 'px',
zIndex: '100' }
} else {
var ulCSSObj = { width: w - (bl
* 2) + 'px',
height: h - (bt * 2) + 'px',
zIndex: '100'}
}
$(ul).css(ulCSSObj);
}
These changes allow first level submenus to appear under the main menu item
even if the main menu item has shifted to another row.
--
View this message in context:
http://www.nabble.com/Plugin-Code-Review%3A-jdMenu-tf3161861.html#a8806687
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/