Code Snippet
Shuffle Children
Nice clean version of a ghetto one that I wrote.
$.fn.shuffleChildren = function() {
$.each(this.get(), function(index, el) {
var $el = $(el);
var $find = $el.children();
$find.sort(function() {
return 0.5 - Math.random();
});
$el.empty();
$find.appendTo($el);
});
};
Usage
$(".parent-element").shuffleChildren();
this is cool I like it.
Cool, nic1
… and if you want shuffle onload:
<pre>$(window).load(function() {
$(“.shuffle”).shuffleChildren();
});
</pre>
Instead of demo page
<pre>$(“#shuffle”).click(function() {
$(“.shuffle”).shuffleChildren();
});
</pre>
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.