[thelist] Event capturing and bubbling

Peter-Paul Koch gassinaumasis at hotmail.com
Tue Feb 12 11:28:35 CST 2002


> >It will definitely have to go into my article.
>Will this be published on your site, or somewhere else?

First on A List Apart, then on my site. I'll inform the list when it's up.

>A large dragable rectangle (div) with some nested content, maybe four divs
>that change color when clicked (a game or menu or something) if you want
>the
>dragable DIV to be dragable from all points, even when clicking the nested
>content, both the contents, and the DIV could have a mousedown listener.

Yes, this is of course possible. However, if I'd write it I'd use different
event handlers (onMouseDown/Up for the dragging and onClick for the colour
change)

Anyway, this is pretty advanced stuff that you won't find on the average web
site, which will be my point.

>Another aspect worth highlighting in an article, is how stopping
>event-bubbling can speed up CSS response on deeply nested elements,
>especially in IE.
>If you take a <a href> and give it a hover style in the stylesheet
>(or was it only using onmouseover="this.style.borderWidth=4" - I'm not sure
>now).
>Now nest it four or five deep (especially in tables), and put 50 on a page,
>you can get visible delays when moving the  mouse over the elements. If you
>put event.cancelBubble=true; in the onmouseover event, the delay is gone.
>All that for IE-only of course.

Interesting! I'll certainly mention it. I'm going to advise to turn bubbling
off anyway, unless you're certain that you want it.

Thanks for your useful feedback, it has made some things clear to me.

ppk

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx




More information about the thelist mailing list