[jQuery] Improved Event system & new Accordion

[jQuery] Improved Event system & new Accordion

An accordian widget would be a nice addition. I know of a few places I myself would use it.
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On Behalf Of "Jörn Zaefferer"
Sent: Thursday, October 26, 2006 6:52 AM
To: jQuery Discussion.
Subject: [jQuery] Improved Event system & new Accordion
Hi folks,
I just commited a few changes to jQuery's event system. I fixed the target property of the event.target for both IE and Safari, and modified bind: It now accepts an optional third parameter that specifies the number of times the handler has to executed. When that amount is reached, it removes the handler. All onexxx events like oneclick now use that option and potentiolly provide better performance.
I updated the accordion plugin to demonstrate and test these changes:
http://joern.jquery.com/accordion/accordion.html
Check these three lines:
$('#list1').accordion()
.oneclick(function() { simpleLog("oneclick"); })
.click(function() { simpleLog("twoclick") }, 2);
It now uses the event delegation pattern as described by Christian Heilmann (http://icant.co.uk/sandbox/eventdelegation/), therefore using only a single click handler and no loops at all. That required the fix for the target property.
By the way, is there interest to put the accordion into the jQuery repository?
--
Jörn Zaefferer
http://bassistance.de
--
GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





























    • Topic Participants

    • alex