Skip to content

Commit fa4379d

Browse files
committed
Merge pull request twbs#12862 from sultano/patch-1
Fixed flickering and simplified calculations
2 parents ead17b7 + f7c360d commit fa4379d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

js/affix.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
var offsetTop = offset.top
5656
var offsetBottom = offset.bottom
5757

58-
if (this.affixed == 'top') position.top += scrollTop
59-
6058
if (typeof offset != 'object') offsetBottom = offsetTop = offset
6159
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
6260
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
@@ -84,7 +82,7 @@
8482
.trigger($.Event(affixType.replace('affix', 'affixed')))
8583

8684
if (affix == 'bottom') {
87-
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
85+
this.$element.offset({ top: position.top })
8886
}
8987
}
9088

0 commit comments

Comments
 (0)