Hi all, I have setup a small class to manage my menu:
Event.observe(window, 'load', init, false);
var myMenu;
function init() {
myMenu = new Menu;
}
var Menu = Class.create({
initialize: function() {
this.activeElement = null;
this.activeElementChild = null;
},
expand: function(id, thisItem) {
this.hideAll();
this.activeElement = thisItem;
this.activeElementChild = $(id.toString());
this.activeElement.addClassName('active');
this.activeElementChild.show();
},
hideAll: function () {
if (this.activeElement != null) {
this.activeElementChild.hide();
this.activeElement.removeClassName('active');
}
$$('#menuNavigation a.active').each( function(item){
item.removeClassName('active');
});
try
{
$('staticThirdLevel').hide();
}
catch(err){}
}
})
I've setup the menu item like this:
<a onclick="myMenu.expand(1, this)">Users</a>
<a onclick="myMenu.expand(2, this)">Dogs</a>
..... etc, etc.....
The problem is that when it arravies to this line:
this.activeElement.addClassName('active');
only in IE (i.e. in Firefox is working) i got the following error:
Object does not support this property or method
any idea? Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---