Skip to content

Commit

Permalink
Fix position issues caused by calculateHeight: true
Browse files Browse the repository at this point in the history
Fixes issues 254, 258 and probably 283
---
When calculateHeight is true, containerSize was set to the calculated height, rather than the width. 

I refactored the code to avoid the double assignment and assign containerSize to height, only for vertical mode (!isH)
  • Loading branch information
dogoku committed Jul 26, 2013
1 parent e324efd commit e6eb446
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dev/idangerous.swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,10 @@ var Swiper = function (selector, params) {
if (!isH) wrapperHeight+=_this.slides[i].getHeight(true);
}
var slideHeight = slideMaxHeight;
if (isH) var wrapperHeight = slideHeight;
containerSize = _this.height = slideHeight;
if (!isH) _this.container.style.height= containerSize+'px';
_this.height = slideHeight;

if (isH) wrapperHeight = slideHeight;
else containerSize = slideHeight, _this.container.style.height= containerSize+'px';
}
else {
var slideHeight = isH ? _this.height : _this.height/params.slidesPerView ;
Expand Down

0 comments on commit e6eb446

Please sign in to comment.