Skip to content

Instantly share code, notes, and snippets.

@higeorange
Created February 18, 2009 08:50
Show Gist options
  • Save higeorange/66261 to your computer and use it in GitHub Desktop.
Save higeorange/66261 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.zebra = function(options){
var default_options = {
class_name: 'zebra',
interval: 2
}
options = $.extend(default_options, options || {})
return this.each(function(i){
if((i + 1) % options.interval == 0)
$(this).addClass(options.class_name)
})
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment