daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('div#navigator a.next').click(function() {
  2.         current_photo = $('ul#photo_viewer li:visible');
  3.         next_id = 'p' + (parseInt(current_photo.attr('id').substring(1)) + 1);
  4.         next_next_id = 'p' + (parseInt(current_photo.attr('id').substring(1)) + 2);
  5.         next_next_next_id = 'p' + (parseInt(current_photo.attr('id').substring(1)) + 3);
  6.         next_photo = $('ul#photo_viewer li#' + next_id);
  7.         console.log(next_id + ' - ' + next_next_id + ' - ' + next_next_next_id );
  8.         if ($('ul#photos li#' + next_id).length > 0 ) {
  9.             current_photo.fadeOut('normal', function() {
  10.                 next_photo.fadeIn('normal', function() {
  11.                     $('div#navigator a.prev').css('background-image', 'url(/images/prev.png)');
  12.                     if ($('ul#photos li#' + next_next_id).length < 1) {
  13.                         $('div#navigator a.next').css('background-image', 'url(/images/next_disabled.png)');
  14.                     }
  15.                     if (($('ul#photos li#' + next_next_next_id).length > 0) && ($('ul#photo_viewer li#' + next_next_next_id).length < 1)) {
  16.                         next_next_next_path = 'photo/complete?pid=' + $('ul#photos li#' + next_next_next_id).find('img').attr('src').substring(11).replace('&size=small','');
  17.                         console.log(next_next_next_path);
  18.                         $.get(next_next_next_path, function(data) {
  19.                             $('ul#photo_viewer').append('<li id=' + next_next_next_id + ' style="display:none;">' + data + '</li>');
  20.                         });
  21.                     }
  22.                 });
  23.                
  24.             });        
  25.         }
  26.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top