Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. $('#find-friends-pick-grid').click(function(e) {
  2. console.log('big click');
  3. var buttons = $(e.target).closest('button').closest('div');
  4. if (!buttons.length) {
  5. return;
  6. }
  7. var active = buttons.find('button:visible');
  8. console.log('click');
  9. console.log(active);
  10. if (active.hasClass('state-follow')) {
  11. buttons.find('button').hide().filter('.state-following').show();
  12. buttons.one('mouseleave', function() {
  13. buttons.hover(function() {
  14. buttons.find('button').hide().filter('.state-unfollow').show();
  15. }, function() {
  16. buttons.find('button').hide().filter('.state-following').show();
  17. });
  18. });
  19. } else if (active.hasClass('state-unfollow')) {
  20. buttons.unbind('mouseenter').unbind('mouseleave');
  21. buttons.find('button').hide().filter('.state-follow').show();
  22. }
  23. });
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement