<p>When using affix in conjunction with adding or removing of elements from the DOM, you'll want to call the refresh method:</p>
<preclass="prettyprint linenums">
$('[data-spy="affix"]').each(function () {
$(this).affix('refresh')
});
</pre>
<h3>Options</h3>
<p>Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-offset-top="200"</code>.</p>
<p>{{_i}}When using affix in conjunction with adding or removing of elements from the DOM, you'll want to call the refresh method:{{/i}}</p>
<preclass="prettyprint linenums">
$('[data-spy="affix"]').each(function () {
$(this).affix('refresh')
});
</pre>
<h3>{{_i}}Options{{/i}}</h3>
<p>{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to <code>data-</code>, as in <code>data-offset-top="200"</code>.{{/i}}</p>