Hugheth
Member since Jan 15, 2010
- Profile: /members/5188-hugheth.htm
- URL: http://hugheth.com
- Comments: 3
Recent Blog Comments By Hugheth
-
jQuery.empty() Kills Event Binding On Persistent Nodes
Posted on Jan 17, 2010 at 6:05 PM
@Ben Nadel, You mentioned reordering nodes inside a container, I thought it might have some relevance. I understand it doesn't directly solve the problem at hand though! If you wanted to write a script that acted purely on the DOM rather than using CSS, I think DOM elements keep their events when ... read more »
-
jQuery.empty() Kills Event Binding On Persistent Nodes
Posted on Jan 16, 2010 at 5:57 PM
@Ben Nadel, The sort function I suggested is the native javascript sort function, a tutorial for that can be found here: http://www.javascriptkit.com/javatutors/arraysort.shtml The example I posted earlier was more a rough suggestion of its functionality so I've written a quick implementation he... read more »
-
jQuery.empty() Kills Event Binding On Persistent Nodes
Posted on Jan 15, 2010 at 1:25 PM
Hey, If you are happy to refactor code, you could try using the .sort() method of the Array object with a jQuery object. e.g. $('.container .node').sort(function(a, b) { // A and B are two Dom elements // If you are shuffling then sort randomly var move = Math.random() - 0.5; // Move the... read more »