Skip to content

Commit

Permalink
v2.0.2 - Fixed bug with data-big not enabled in images
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalarcon committed Dec 18, 2018
1 parent 5ad0202 commit eb10517
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/jquery.pan.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/jquery.pan.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery.pan",
"version": "2.0.1",
"version": "2.0.2",
"description": "Fullscreen Image Zoom and Pan with Jquery",
"main": "jquery.pan.js",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions src/js/jquery.pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ jQuery.fn.extend({
//Remove from set those image elements that are already shown in their natural size (they don't need zoom at all)
//If the element is not an image it's not filtered
var finalSet = $(this).filter(function() {
if (this.tagName == "IMG" ) {
if ($(this).attr('data-big'))
return true;
if (this.tagName == "IMG") {
var nW = this.naturalWidth || 0,
nH = this.naturalHeight || 0,
w = $(this).outerWidth(),
h = $(this).outerHeight();
if (nW > w || nH > h)
return true;
return (nW > w || nH > h);
}
else {
return true;
Expand Down

0 comments on commit eb10517

Please sign in to comment.