Created
March 31, 2016 16:31
-
-
Save jdcauley/2dec5e9c3fc1e13021dedc4d39b46480 to your computer and use it in GitHub Desktop.
bootstrap affix for widgets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var StickyWidget = $('.sidebar .widget:last-child'); | |
if(StickyWidget){ | |
var trigger = StickyWidget.offset().top - $('#primary-masthead').height(); | |
StickyWidget.affix({ | |
offset: { | |
top: function(){ | |
return trigger; | |
}, | |
bottom: function () { | |
return (this.bottom = $('.footer-wrap').outerHeight(true)) | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment