olcluw
Last Updated: February 25, 2016
·
606
· zaus
D940dd93751cea6229c4b9b2098b7f39

jquery.removeClassWhere plugin

The missing jQuery function to easily remove classes matching a filter -- combines $el.removeClass and $.grep.

https://gist.github.com/zaus/5221271

Example:

$links.click(function() {
    $container
            .removeClassWith('has-')
            .addClass('has-' + $(this).attr('href').replace('#', ''))
            ;
});
Say Thanks
Respond