How to get dynamic data-offset values for Bootstrap 3 affix method
You could use jQuery to get the dynamic content height above the navbar. For example: $(‘#nav’).affix({ offset: { top: $(‘header’).height() } }); Working demo: http://bootply.com/69848 In some cases, offset.bottom must also be calculated to determine when to “un-affix” the element. Here’s an example of affix-bottom