Guest User

Untitled

a guest
Jun 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. $(document).ready(function() {
  2. $('a.next').click(function() {
  3. var cur_left = $('#thumb_container').css('left');
  4. var next_left = parseInt(cur_left) - parseInt(520);
  5. var width = $('#thumb_container').css('width');
  6. if(next_left < '-' + width.substr(0,3)) {
  7. return false;
  8. } else {
  9. $('#thumb_container').animate({left:next_left + 'px'}, {queue:false, duration:300});
  10. return false;
  11. };
  12. });
  13.  
  14. $('a.prev').click(function() {
  15. var cur_left = $('#thumb_container').css('left');
  16. var next_left = parseInt(cur_left) + parseInt(520);
  17. var width = $('#thumb_container').css('width');
  18. if(next_left >= width.substr(0,3)) {
  19. return false;
  20. } else {
  21. $('#thumb_container').animate({left:next_left + 'px'}, {queue:false, duration:300});
  22. return false;
  23. };
  24. });
  25.  
  26. $('.thumb').click(function() {
  27. var pos = $(this).attr('rel');
  28. $('#project_cont').animate({left:'-' + pos + 'px'}, {queue:false, duration:300});
  29. return false;
  30. });
  31.  
  32. $('.thumbnail').click(function() {
  33. var img = $(this).attr('href');
  34. $(this).parent().parent().parent().parent().fadeOut('slow',function() {
  35. $(this).css('background-image', 'url(' + img + ')');
  36. $(this).fadeIn('slow');
  37. });
  38. return false;
  39. });
  40.  
  41. $('.project_info').css('top', '370px');
  42. $('.project_info').hover(function() {
  43. if($(this).is(':not(:animated)')) {
  44. $(this).animate({top: '180px'});
  45. $(this).css('cursor', 'pointer');
  46. } else {
  47. return false;
  48. };
  49. }, function() {
  50. if($(this).is(':not(:animated)')) {
  51. $(this).animate({top: '370px'});
  52. } else {
  53. return false;
  54. };
  55. });
  56. });
Add Comment
Please, Sign In to add comment