Skip to content

Commit

Permalink
Merge pull request #16409 from twbs/fix-16361
Browse files Browse the repository at this point in the history
Document Affix plugin's `checkPosition` method
  • Loading branch information
cvrebert committed May 4, 2015
2 parents 9d96cb9 + 85235c5 commit a19441d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/_includes/js/affix.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ <h3 id="affix-options">Options</h3>
</table>
</div><!-- /.table-responsive -->

<h3 id="affix-methods">Methods</h3>

<h4><code>.affix(options)</code></h4>
<p>Activates your content as affixed content. Accepts an optional options <code>object</code>.</p>
{% highlight js %}
$('#myAffix').affix({
offset: 15
})
{% endhighlight %}

<h4><code>.affix('checkPosition')</code></h4>
<p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The <code>.affix</code>, <code>.affix-top</code>, and <code>.affix-bottom</code> classes are added to or removed from the affixed content according to the new state. This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
{% highlight js %}$('#myAffix').affix('checkPosition'){% endhighlight %}

<h3 id="affix-events">Events</h3>
<p>Bootstrap's affix plugin exposes a few events for hooking into affix functionality.</p>
Expand Down
1 change: 1 addition & 0 deletions docs/_includes/nav/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<li><a href="#affix-examples">Examples</a></li>
<li><a href="#affix-usage">Usage</a></li>
<li><a href="#affix-options">Options</a></li>
<li><a href="#affix-methods">Methods</a></li>
<li><a href="#affix-events">Events</a></li>
</ul>
</li>

0 comments on commit a19441d

Please sign in to comment.