Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for jQuery 3 #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions js/jquery.prettyPhoto.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@

if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); // Hide the flash

_checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images.
_checkPosition($(pp_images).length); // Hide the next/previous links if on first or last images.

$('.pp_loaderIcon').show();

Expand All @@ -208,7 +208,7 @@
$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);

// Display the current position
$pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size());
$pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).length);

// Set the description
if(typeof pp_descriptions[set_position] != 'undefined' && pp_descriptions[set_position] != ""){
Expand Down Expand Up @@ -241,7 +241,7 @@

// Preload the neighbour images
nextImage = new Image();
if(isSet && set_position < $(pp_images).size() -1) nextImage.src = pp_images[set_position + 1];
if(isSet && set_position < $(pp_images).length -1) nextImage.src = pp_images[set_position + 1];
prevImage = new Image();
if(isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];

Expand Down Expand Up @@ -382,10 +382,10 @@

if(direction == 'previous') {
set_position--;
if (set_position < 0) set_position = $(pp_images).size()-1;
if (set_position < 0) set_position = $(pp_images).length-1;
}else if(direction == 'next'){
set_position++;
if(set_position > $(pp_images).size()-1) set_position = 0;
if(set_position > $(pp_images).length-1) set_position = 0;
}else{
set_position=direction;
};
Expand Down