jqbuild
Version:
A command line build tool for jQuery plugins.
12 lines (8 loc) • 307 B
JavaScript
// jQuery Random - v0.1.0 - http://benalman.com/
// Copyright (c) 2011 Ben Alman; Licensed MIT, GPL
(function($){
$.fn.random = function(selector) {
var elems = selector ? this.filter(selector) : this;
return this.pushStack(elems.eq(Math.floor(Math.random() * elems.length)));
};
}(jQuery));