/    Sign up×
Community /Pin to ProfileBookmark

.not() not limiting elements – any help?

hello,

I am having a hard time only selecting the top level of my navigation as the trigger for the sub-nav dropdown. Seems that when you mouse over the sub navs it queues the function and then does the drop down multiple times (pending on how many li’s you’ve moused over).

Any explanation would be rad!

Here’s what I have:

[code=html] $(‘ul#menu-top-nav li’).not(“ul#menu-top-nav ul.sub-menu li”).mouseover(function() {
var theID = $(this).attr(‘id’);
$(“ul.menu li#”+theID+’ ul.sub-menu’).show(‘fast’).delay(2000).hide(‘fast’);
});[/code]

I also tried:

[code=html] $(‘ul#menu-top-nav li > ul’).mouseover(function() {
var theID = $(this).attr(‘id’);
$(“ul.menu li#”+theID+’ ul.sub-menu’).show(‘fast’).delay(2000).hide(‘fast’);
});[/code]

Here is the site, in case you want to check it out:
[url]http://cooperadr.com/[/url]

Thank you!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Jeff_MottSep 08.2011 — How about...

// Select top-nav list items
$('ul#menu-top-nav > li')
×

Success!

Help @_var 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 5.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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