mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Merge pull request #12862 from sultano/patch-1
Fixed flickering and simplified calculations
This commit is contained in:
commit
fa4379de08
1 changed files with 1 additions and 3 deletions
|
@ -55,8 +55,6 @@
|
||||||
var offsetTop = offset.top
|
var offsetTop = offset.top
|
||||||
var offsetBottom = offset.bottom
|
var offsetBottom = offset.bottom
|
||||||
|
|
||||||
if (this.affixed == 'top') position.top += scrollTop
|
|
||||||
|
|
||||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||||
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
||||||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
||||||
|
@ -84,7 +82,7 @@
|
||||||
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
||||||
|
|
||||||
if (affix == 'bottom') {
|
if (affix == 'bottom') {
|
||||||
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
|
this.$element.offset({ top: position.top })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue