1 reply [Last post]
gazzou
Offline
newbie
Last seen: 15 years 9 weeks ago
Joined: 2007-03-28
Posts: 1
Points: 0

I am trying to modify the .js drop-down menu from Suckerfish (forcing the dropdown ul to appear in IE) to act on the "onClick" event instead of the "onMouseOver".

When I click it, it opens up my menu. The problem is as soon as I mouse over an "a" element it triggers the "onMouseOut" event.

How should I proceed to prevent the triggering of the "onMouseOut" event until I actually am out of my drop-down menu?

These are my two functions: (Same as Suckerfish except using "onCLick")

sfEls[i].onclick=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
this.parentNode.className+=(this.parentNode.className.length>0? " ": "") + "sfhover";
this.className=this.className.replace(new RegExp("( ?|^)sub_menu\\b"), "sub_mnu_sfhvr");
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
this.parentNode.className=this.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
this.className=this.className.replace(new RegExp("( ?|^)sub_mnu_sfhvr\\b"), "sub_menu");
}

Thanks in advance for your help,

Gazzou

Tags:
Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 20 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Moving to 'Off Topic' this

Moving to 'Off Topic' this is a scripting question and the forum is primarilly geared to CSS.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me