Skip to content

Commit 95e21fd

Browse files
committed
Height updating optimized
1 parent 6edba2e commit 95e21fd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-carousel",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"main": ["./jquery.carousel.js"],
55
"author": "Thomas Jaggi",
66
"dependencies": {

jquery.carousel.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,16 +988,16 @@
988988

989989
// Update slider based on currently visible slides
990990
// TODO: called twice on init
991-
_updateHeight: function(targetHeight) {
991+
_updateHeight: function() {
992992
var minIndex = this.props.currentDomIndex,
993993
maxIndex = minIndex + this.props.visible,
994994
filterSelector = (minIndex > 0) ? ':gt(' + (minIndex - 1) + '):lt(' + this.props.visible + ')' : ':lt(' + (maxIndex) + ')',
995995
maxHeight = this._getHighestSlide(),
996+
currentFrameHeight = this.$dom.frame.height(),
996997
height = this._getHighestSlide(filterSelector);
997998

998-
if (targetHeight) {
999-
height = targetHeight;
1000-
maxHeight = '100em';
999+
if (maxHeight < currentFrameHeight) {
1000+
maxHeight = currentFrameHeight;
10011001
}
10021002

10031003
this.$dom.slides.css('min-height', maxHeight);

0 commit comments

Comments
 (0)