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 3624136
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:28:12+00:00 2026-05-18T23:28:12+00:00

Im testing out something here,so please excuse the css rules.I have got a ul

  • 0

Im testing out something here,so please excuse the css rules.I have got a ul list in a div,and im trying to trigger a alert on the mouseout of the div but the alert triggers each time i mouseout the li items in the ul. Could some please tell me the reason behind it? I guess its something to so with bubbling but im not sure.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style>
#box{
cursor:pointer;width:300px;height:500px;background-color:#F1E0BB;
}

ul#myList{
list-style:none;padding-top:20px;
}

ul#myList li{
font-family:Arial;font-size:20px;font-weight:bold;height:40px;cursor:pointer;border:solid 1px #000;
}
</style>
</head>
<body>

<div id="box">
    <ul id="myList">
        <li>Item 11</li>
        <li>Item 12</li>
        <li>Item 13</li>
        <li>Item 14</li>
        <li>Item 15</li>
    </ul>
</div>


</body>
</html>

Jquery script i used

$('#box').mouseout(function(){

alert("ccc");

})
  • 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-05-18T23:28:13+00:00Added an answer on May 18, 2026 at 11:28 pm

    Use the mouseleave event here instead, which doesn’t fire when leaving children:

    $('#box').mouseleave(function(){
      alert("ccc");
    });
    

    You’re assumption about bubbling is correct, it’s those child elements bubbling up that’s triggering your handler. From the .mouseleave() docs:

    The mouseleave event differs from mouseout in the way it handles event bubbling. If mouseout were used in this example, then when the mouse pointer moved out of the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseleave event, on the other hand, only triggers its handler when the mouse leaves the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse leaves the Outer element, but not the Inner element.

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

Sidebar

Related Questions

I am starting out with unit testing, I have a method that uses the
I am just starting out with DI & unit testing and have hit a
I've been testing out the performance and memory profiler AQTime to see if it's
I'm testing out my application with the hopes of migrating to SQL Server 2008
I'm finally starting out with unit testing, having known that I should be doing
I am starting out with automated testing and I would like to test one
I'm having trouble figuring out how to get the testing framework set up and
I personally don't use FxCop yet. We want to work out the unit testing
I'm new in QT, and I'm just testing out the MOC. For a given
As a developer, I'm a newbie to Unit testing and have a requirement to

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.