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

  • SEARCH
  • Home
  • 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 7863817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:36:09+00:00 2026-06-02T23:36:09+00:00

When I mouseover .mensal DIV it will trigger the mouseover the parent .opera DIV,

  • 0

When I mouseover .mensal DIV it will trigger the mouseover the parent .opera DIV, which seems wrong to me. I just want the “highlight” effect to to work on the child .opera DIV.

#operaContent {
  padding: 0 50px 0 50px;
  position: relative;
  overflow: visible;
}
#operaContent .opera {
  display: block;
  border: 1px solid #FFFFFF;
  border-bottom: 1px solid #DDDDDD;
  padding: 5px;
  margin-bottom: 10px;
  height: 120px;
  background-color: #0A8ECC;
}
#operaContent .opera:hover {
  border: 1px solid #AAAAAA;
  background-color: #DDDDDD;
  cursor: pointer;
}
.mensal {
  position: absolute;
  top: 1px;
  left: 8px;
  z-index: 3;
  display: block;
}
<div id="operaContent">
  <div class="opera">
    <div class="mensal">
      DIV
    </div>
  </div>
</div>
  • 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-02T23:36:10+00:00Added an answer on June 2, 2026 at 11:36 pm

    By definition, hovering over a child, hovers over the parent as well. There is no “blocking” in html events.

    There are two method chains, the bubble and the capture.

    Any event taking place in the W3C event model is first captured until
    it reaches the target element and then bubbles up again.

    http://www.quirksmode.org/js/events_order.html

    The only way you’re going to stop this is to prevent the bubbling by adding javascript to your page to prevent the chain. This is simple in jQuery

    $('.mensal').hover(function(e){
        e.stopPropagation();
    
    });
    

    It occurs to me that this answer is completely unhelpful when dealing with CSS. Javascript events dont deal with CSS selectors or preventing them.

    Unfortunately, with CSS alone, I do not know of a way to accomplish this (and even in javascript it can get tricky). CSS 4 selectors will allow you to specify the subject of the selector http://dev.w3.org/csswg/selectors4/#subject so that you can do something like

     #operaContent .opera:hover! .mensal:not(:hover) { /*your css*/ }
    

    but this isnt implemented yet, and is still under development for the draft.

    EDIT:
    Here is a javascript (jQuery) implementation that should work for you

    ​

    $(function(){
        $('.opera').hover(function() {$(this).addClass('hoverIntent')}, 
                          function(){ $(this).removeClass('hoverIntent'); }
                         );
    
        $('.opera .mensal').hover(function() {
            $(this).parent('.opera').removeClass('hoverIntent');
        });
    
    })​
    

    and the modified CSS

    #operaContent {
        padding: 0 50px 0 50px;
        position: relative;
        overflow: visible;
    }
    
    #operaContent .opera {
        display: block;
        border: 1px solid #FFFFFF;
        border-bottom: 1px solid #DDDDDD;
        padding: 5px;
        margin-bottom: 10px;
        height: 120px;
        background-color: #0A8ECC;
    }
    
    
    #operaContent .opera.hoverIntent {
        border: 1px solid #AAAAAA;
        background-color: #DDDDDD;
        cursor: pointer;
    }
    
    .mensal {
        position: absolute;
        top: 1px;
        left: 8px;
        z-index: 3;
        display: block;
    }​
    

    and the obligitory working demo: http://jsfiddle.net/WB6Ty/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to do a 3d mouseover effect when you're over a DIV. Here's
I am implementing a mouseover, which changes the background of a div onMouseDown, and
I want to add a MouseOver event handler for any tag. Let say just
I currently have a mouseover/mouseout event - I want to show a div after
I have this code: $(div[id^='intCell']).mouseover(function() { $(this).css({ border:,1px solid #ff097c}); }).mouseout(function() { $(this).css({border:,1px solid
IF NOT mouseover/-enter/click on div menu THEN do stuff ELSE do other stuff? I
$('.star').mouseover(function (){ var star = $(this).index()1; $(this).parent().css(background-position,0 - (32 * star) px); }); $('.star-rating').mouseout(function
I have a mouseover effect that when a client hovers a flag, a picture
I am trying to make a simple mouseover effect on a button, It does
When I mouseover .thumb I want the src to be replaced by hello.gif and

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.