UNPKG
jqbuild
Version:
latest (0.1.0)
0.1.0
A command line build tool for jQuery plugins.
github.com/cowboy/node-jqbuild
cowboy/node-jqbuild
jqbuild
/
examples
/
custom-banner
/
src
/
random.js
9 lines
(6 loc)
•
207 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
(
function
(
$
) { $.fn.
random
=
function
(
selector
) {
var
elems = selector ?
this
.
filter
(selector) :
this
;
return
this
.
pushStack
(elems.
eq
(
Math
.
floor
(
Math
.
random
() * elems.
length
))); }; }(jQuery));