[jQuery] New Plugin: Clone Events

[jQuery] New Plugin: Clone Events

I've noticed several times on the list people asking why .clone()
doesn't clone the events along with the elements. No more worries ...
now you can clone those events if you need too!
var $elements = $('.elements');
$elements
.clone()
.cloneEventsFrom($elements);
There is also a .cloneEventsTo() which acts like .appendTo().
var $elements = $('.elements');
var $clonedElements = $elements.clone();
$elements.cloneEventsTo($cloneElements);
You can find this plugin in SVN:
http://jquery.com/dev/svn/trunk/plugins/cloneEvents/cloneEvents.js?format=txt
You can run the unit tests here:
http://brandon.jquery.com/plugins/cloneEvents/test/unit.html
--
Brandon Aaron
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/