That seems to work - sort of...

$("#main").bind("mouseleave", function(event) {
        alert(event.target.id);
});

But I'm still having problems...when I use event.target.id the results
are inconsistent surprisingly in Firefox and not IE.

Also, it is worth noting I needed to use the latest jQuery release
1.2.3.


On Mar 3, 5:25 pm, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> skube, try *mouseleave*  instead, that one take bubbling into account.
>
> On 3/3/08, skube <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I am a little confused about event bubbling. Say for example I have
> > the following bit of HTML:
>
> > <code>
> > <div id="main">
> >         <div id="one">
> >                 one
> >         </div>
> >         <div id="two">
> >                 two
> >         </div>
> > </div>
> > </code>
>
> > when I try:
> > <code>
> > $("#main").mouseout(function() {
> >         alert('test');
> > });
> > </code>
>
> > The alert gets fired even when mousing in/out of divs one/two, but
> > while still staying within the main div.
>
> > How do I fire the alert only if I mouseout of everything (including
> > main), not just out of one and into two?
>
> --
> Benjamin 
> Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjaminsterling.com

Reply via email to