Skip to content

Commit

Permalink
Merge pull request #12862 from sultano/patch-1
Browse files Browse the repository at this point in the history
Fixed flickering and simplified calculations
  • Loading branch information
fat committed Mar 17, 2014
2 parents ead17b7 + f7c360d commit fa4379d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/affix.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
var offsetTop = offset.top
var offsetBottom = offset.bottom

if (this.affixed == 'top') position.top += scrollTop

if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
Expand Down Expand Up @@ -84,7 +82,7 @@
.trigger($.Event(affixType.replace('affix', 'affixed')))

if (affix == 'bottom') {
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
this.$element.offset({ top: position.top })
}
}

Expand Down

0 comments on commit fa4379d

Please sign in to comment.