Skip to main content

Hugheth

Member since Jan 15, 2010

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 »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel