/    Sign up×
Community /Pin to ProfileBookmark

Javascript drop down menu affected by flash page content

Hi everyone, i wonder if anyone can help with this problem.

Basically, i have a multi-level drop down menu bar at the top of my web page which uses javascript to add a css class to the menu to display the appropriate links when the main tab is hovered over. Before i go any further – here’s the JS code that i’m using:

[CODE]

sfHover = function()
{
var sfEls = document.getElementById(“mainlevelmainnav”)
.getElementsByTagName(“LI”);
for (var i=0; i < sfEls.length; i++)
{
sfEls[i].onmouseover=function()
{
this.className+=” sfhover”;
}
sfEls[i].onmouseout=function()
{
this.className=this.className.replace(new RegExp(” sfhover\b”), “”);
}
}
}
if (window.attachEvent){
window.attachEvent(“onload”, sfHover);
}

[/CODE]

This code works great cross browser and on all web pages APART from those which contein flash content. I have a flash based gallery on one of my web pages and. Before the user inetracts with the flash gallery (i.e. clicks on it/a photo) the menu works fine. However as soon as the lash content has been clicked on, the menu behaves strangely. The drop down menu items still display, but the ‘onmouseout’ function doesn’t seem to work as the drop down menu items don’t retract – they stay on the screen. This means that you can hover over all menu tabs, and display all menu items at once accross the whole menu and they all just stay on the screen and don’t retract back up as they should.

Strangely, this appears to be an IE issue and is not present in Firefox/safari etc.

I would really appreciate some help as i’m pulling my hair out here!

Thanks!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @robc3129 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...