jQuery Selector & Exclusion

I have the following codes, basically the alert should only fire if the user moves the cursor outside of the main box, it should never fire inside even when switching hover between div's inside the main box. That's why I tried :not(#main *), but that doesn't seem to work.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
		<title>Test Page</title>
				margin:50px 0px; 
				padding: 0px;
				text-align: center;
			#main {
				height: 500px;
				margin:0px auto;
				border:1px dashed #333;
			#navbar {
				background-color: #cc0000;
				margin-bottom: 250px;
		<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
				$("*:not(#main *)").mouseover(function(){
					alert("mouse out");
				}, function() {});
	<body id="body-content">
		<div id="main">	
			<div id="navbar">
				Heres the navigation bar menu....
			<div id="box">
				Heres some content in the box....

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Use mouseleave
or hover( I think that also works )

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jwzkAuthor Commented:
Wow, didn't know that existed. Mouseleave is exactly what I was looking for, thanks!
jwzkAuthor Commented:
Exactly what I was looking to do
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.