jQuery.extend
jQuery.extend
Hi
how can i extend a filter so that i can invoke it like:
-
$('#ka:eq(2)')...; // This version cause a warning in ff: unknown pseudo class ...
$('#ka').eq(2)...; // But fortunately i can use the filter this way
when i extend it like this
-
jQuery.extend(jQuery.expr[":"], {
random: function(a, i, m, r) {
return Math.random() < m[3] * 1;
}
});
i can only:
-
$('#ka:random(0.5)')... // which works but also causes a warning in ff
but not
-
$('#ka').random(0.5)... // which would not cause a warning
how do i extend it properly?