I have a question for everyone, and especially aNoble. I’m using the javascript for dropdown menus aNoble wrote here is the code I’m using:
/*
Written by: Adam Crownoble ([email protected])
Date: April 3 2006
License: LGPL (http://www.gnu.org/copyleft/lesser.html)
*/
var DropDownMenu = Class.create();
DropDownMenu.prototype = {
initialize: function(menuElement) {
this.menu = menuElement;
this.id = menuElement.id;
this.duration = 250;
this.buttons = $A(this.menu.getElementsByTagName('li')).findAll(
function(li) {
return (li.parentNode == menuElement);
}
);
this.submenus = $A(this.menu.getElementsByTagName('ul'));
this.submenus.each(
function(submenu) {
Element.show(submenu);
submenu.originalHeight = Element.getHeight(submenu);
submenu.effect = new fx.Height(submenu, { duration: this.duration });
submenu.effect.hide();
}.bind(this)
);
this.buttons.each(
function(button) {
Event.observe(button, 'mouseover',this.expand.bindAsEventListener(this));
Event.observe(button, 'mouseout', this.collapse.bindAsEventListener(this));
}.bind(this)
);
},
findButton: function(element) {
var button = false;
while(element.parentNode) {
if(this.buttons.include(element)) { button = element; }
element = element.parentNode;
}
return button;
},
findSubmenu: function(element) {
var button = this.findButton(element);
var submenu = button.getElementsByTagName('ul')[0];
return submenu;
},
expand: function(event) {
var submenu = this.findSubmenu(Event.element(event));
submenu.effect.clearTimer();
submenu.effect.custom(submenu.effect.now, submenu.originalHeight);
},
collapse: function(event) {
var submenu = this.findSubmenu(Event.element(event));
submenu.effect.clearTimer();
submenu.effect.custom(submenu.effect.now, 0);
}
};
the site is
http://heav.org/
The problem is when using AOL and some other browsers on Mac’s the dropdowns just don’t work. I looked at the dropdowns on
http://www.bryan.edu/, and I’m assuming the js code is the same. when
http://www.bryan.edu/ is viewed on a Mac, the black bar expands to hold the extended menu. Likewise on my site,
http://heav.org/, the section that holds the initial nav bar expands to hold the full menu.
another problem I am having, and it may not be related, is that the whole site header is missing from the index page, but not from the other pages.
Again, all these problems are when viewed on an Apple computer, OSX 10.3 using firefox, IE, and AOL. For Safari the menus won’t even drop!
If anyone can shed some light on this, or point me in the right direction, I’d love it!