Skip to content

Commit

Permalink
Do not process resize event if fotorama is hidden
Browse files Browse the repository at this point in the history
Resize event recalcs image dimensions in wrong way (see example https://jsfiddle.net/doochik/1mdhtbav/).
In this case we should stop processing resize event if fotorama is hidden.
As a workaround for this bug we can use `position:abosulte;left:-9990px;top:-9999px` instead of `display: none` to hide fotorama.
  • Loading branch information
doochik committed Mar 31, 2016
1 parent a469950 commit 2d72f8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/fotorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,8 @@ jQuery.Fotorama = function ($fotorama, opts) {
});

that.resize = function (options) {
if (!data) return this;
// don't process resize for hidden elements
if (!data || $wrap.is(':hidden')) return this;

var time = arguments[1] || 0,
setFLAG = arguments[2];
Expand Down

0 comments on commit 2d72f8f

Please sign in to comment.