Skip to content

Instantly share code, notes, and snippets.

@yratof
Created June 30, 2015 14:33
Show Gist options
  • Select an option

  • Save yratof/f5457462532321612b63 to your computer and use it in GitHub Desktop.

Select an option

Save yratof/f5457462532321612b63 to your computer and use it in GitHub Desktop.
Add state remove state to hovered items
jQuery(document).ready(function($){
$('.area').on('hover', function(){
$('.area').addClass('unwanted');
$(this).addClass('pick-me');
$(this).removeClass('unwanted');
});
$('.area').on('mouseleave', function(){
$('.area').removeClass('unwanted');
$('.area').removeClass('pick-me');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment