From 0540b63ab0a2f9359fbd34967fbb74402534573f Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 24 Sep 2012 23:59:02 -0700 Subject: check affix pos on clicks - use timeout for clicks which scroll --- js/bootstrap-affix.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/bootstrap-affix.js b/js/bootstrap-affix.js index 96bf420d2..c6b9e97b6 100644 --- a/js/bootstrap-affix.js +++ b/js/bootstrap-affix.js @@ -28,7 +28,9 @@ var Affix = function (element, options) { this.options = $.extend({}, $.fn.affix.defaults, options) - this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) + this.$window = $(window) + .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) this.$element = $(element) this.checkPosition() } -- cgit v1.2.3