Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('div#navigator a.next').click(function() {
- current_photo = $('ul#photo_viewer li:visible');
- next_id = 'p' + (parseInt(current_photo.attr('id').substring(1)) + 1);
- next_next_id = 'p' + (parseInt(current_photo.attr('id').substring(1)) + 2);
- next_next_next_id = 'p' + (parseInt(current_photo.attr('id').substring(1)) + 3);
- next_photo = $('ul#photo_viewer li#' + next_id);
- console.log(next_id + ' - ' + next_next_id + ' - ' + next_next_next_id );
- if ($('ul#photos li#' + next_id).length > 0 ) {
- current_photo.fadeOut('normal', function() {
- next_photo.fadeIn('normal', function() {
- $('div#navigator a.prev').css('background-image', 'url(/images/prev.png)');
- if ($('ul#photos li#' + next_next_id).length < 1) {
- $('div#navigator a.next').css('background-image', 'url(/images/next_disabled.png)');
- }
- if (($('ul#photos li#' + next_next_next_id).length > 0) && ($('ul#photo_viewer li#' + next_next_next_id).length < 1)) {
- next_next_next_path = 'photo/complete?pid=' + $('ul#photos li#' + next_next_next_id).find('img').attr('src').substring(11).replace('&size=small','');
- console.log(next_next_next_path);
- $.get(next_next_next_path, function(data) {
- $('ul#photo_viewer').append('<li id=' + next_next_next_id + ' style="display:none;">' + data + '</li>');
- });
- }
- });
- });
- }
- });
Add Comment
Please, Sign In to add comment