Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Created October 6, 2009 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/202919 to your computer and use it in GitHub Desktop.
Save kirkegaard/202919 to your computer and use it in GitHub Desktop.
jQuery.jQueryRandom = 0;
jQuery.extend(jQuery.expr[":"], {
random: function(a, i, m, r) {
if (i == 0) {
jQuery.jQueryRandom = Math.floor(Math.random() * r.length);
};
return i == jQuery.jQueryRandom;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment