Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:23:17+00:00 2026-06-13T22:23:17+00:00

<div id=a> <div id=b nopopup> <div id=c> <div id=d> I use a jQuery .hover()

  • 0
<div id="a">
  <div id="b" nopopup>
    <div id="c"> 
      <div id="d">

I use a jQuery .hover() to popup a menu when particular <div>s are moused over. A string, $selector, identifies which <div>s get a hover.

$($selector).hover( 
  // popup the menu
)

That works. I now want to thwart operation of the .hover() when an ancestor <div> has the valueless attribute “nopopup”, as <div> b above does. That “nopopup” would thwart any hover for c and d, even if the $selector selected them. The number of levels between the hover candidate and the thwarting nopopup varies.

I need something like:

$($selector).not( one of the selected node's parents has the attribute "nopopup" ).hover( 
  // popup the menu
)

What goes in those parentheses? Or is this the wrong approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:23:18+00:00Added an answer on June 13, 2026 at 10:23 pm

    Can use several approaches. Following assumes that nopopup is a class since html isn’t valid

    $($selector).hover( 
      if( !$(this).closest('.nopopup').length){
           /* run code when nopop isn't ancestor*/
       }
    )
    

    OR

    $($selector).not('.nopopup '+$selector).hover(....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div which contain lots of input[type=text] fields. I want to put
div li:first-child what does above css selector target? First li's of every div on
box div will be hidden during pageload, when we hover on it it should
My div is closing itself. <html><head><title></title> <script type=text/javascript charset=utf-8 src=jquery-1.7.min.js></script> <script> $(document).ready(function(){ $(#wrapper).append( '<div
I would like to trigger a popup box using the function provide by jquery
One div works fine, however when using multiple divs they all get expanded simultaneously.
$('div#searchResult > div#searchResultItem > div#item').hover(function() { alert($(this).text()); }); Hi guys. Im doing a quick
I'm creating a div which is shown(toggled) by clicking on another element. It should
Div box dimensions are measured using jQuery with following code: $(document).ready(function(){ var h =
$('div#Categories > div.categories a#showhide').click(function(){ // Get the subManufacturers list var subCatList = $(this).parent().find('ul#hiddenSubCategories'); //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.