Guest User

Untitled

a guest
Oct 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $('#recentWork li a').click(function() {
  2.  
  3. var $this = $(this);
  4.  
  5. if ( !$this.parent('li').hasClass('chosen') ) {
  6.  
  7. var url = this.href,
  8. height = $('.image_display img').css('height');
  9.  
  10. $this
  11. .parents('ol')
  12. .find('li.chosen')
  13. .removeClass('chosen');
  14.  
  15. $this.parent('li').addClass('chosen');
  16.  
  17. $('.image_display')
  18. .css('height', height)
  19. .children('img')
  20. .fadeOut(400, function() {
  21. $(this).attr('src', url).load(function() {
  22. $(this).fadeIn(400);
  23. });
  24.  
  25. $this.parents('#recentWork')
  26. .find('p:last')
  27. .empty()
  28. .html('<p>' + $this.attr('title') + '</p>');
  29. });
  30.  
  31. }
  32.  
  33. return false;
  34.  
  35. });
Add Comment
Please, Sign In to add comment