diff options
| author | Mark Otto <[email protected]> | 2014-07-23 20:39:40 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-07-23 20:39:40 -0700 |
| commit | 463fe476d89fc9d9afd0da3c13b5a051b5a0d2fb (patch) | |
| tree | 08d16bbd093ab90e87038f97331ffc2e58aa992e /docs/_includes/js | |
| parent | 5713bd74d617126796205d4ee29bfc6ff192ad39 (diff) | |
| parent | 38335b2a3dcaac8bb706b5542e10f8edd8ea6a5e (diff) | |
| download | bootstrap-463fe476d89fc9d9afd0da3c13b5a051b5a0d2fb.tar.xz bootstrap-463fe476d89fc9d9afd0da3c13b5a051b5a0d2fb.zip | |
Merge pull request #14166 from hnrch02/docs-cleanup
Docs cleanup
Diffstat (limited to 'docs/_includes/js')
| -rw-r--r-- | docs/_includes/js/affix.html | 20 | ||||
| -rw-r--r-- | docs/_includes/js/alerts.html | 24 |
2 files changed, 23 insertions, 21 deletions
diff --git a/docs/_includes/js/affix.html b/docs/_includes/js/affix.html index 4ce51cb34..56168d6a8 100644 --- a/docs/_includes/js/affix.html +++ b/docs/_includes/js/affix.html @@ -14,8 +14,8 @@ <p>Here's how the affix plugin works:</p> <ol> <li>To start, the plugin adds <code>.affix-top</code> to indicate the element is in its top-most position. At this point no CSS positioning is required.</li> - <li>Scrolling past the element you want affixed should trigger the actual affixing. This is where <code>.affix</code> replaces <code>.affix-top</code> and sets <code>position: fixed;</code> (provided by Bootstrap's code CSS).</li> - <li>If a bottom offset is defined, scrolling past that should replace <code>.affix</code> with <code>.affix-bottom</code>. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add <code>position: absolute;</code> when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.</li> + <li>Scrolling past the element you want affixed should trigger the actual affixing. This is where <code>.affix</code> replaces <code>.affix-top</code> and sets <code>position: fixed;</code> (provided by Bootstrap's CSS).</li> + <li>If a bottom offset is defined, scrolling past it should replace <code>.affix</code> with <code>.affix-bottom</code>. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add <code>position: absolute;</code> when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.</li> </ol> <p>Follow the above steps to set your CSS for either of the usage options below.</p> @@ -31,14 +31,14 @@ <h3>Via JavaScript</h3> <p>Call the affix plugin via JavaScript:</p> {% highlight js %} - $('#my-affix').affix({ - offset: { - top: 100 - , bottom: function () { - return (this.bottom = $('.footer').outerHeight(true)) - } +$('#myAffix').affix({ + offset: { + top: 100, + bottom: function () { + return (this.bottom = $('.footer').outerHeight(true)) } - }) + } +}) {% endhighlight %} @@ -75,7 +75,7 @@ <h3>Events</h3> - <p>Bootstrap's affix class exposes a few events for hooking into affix functionality.</p> + <p>Bootstrap's affix plugin exposes a few events for hooking into affix functionality.</p> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html index e9cb8c871..2f6b33368 100644 --- a/docs/_includes/js/alerts.html +++ b/docs/_includes/js/alerts.html @@ -3,14 +3,12 @@ <h2 id="alerts-examples">Example alerts</h2> <p>Add dismiss functionality to all alert messages with this plugin.</p> - <div class="bs-example"> + <div class="bs-example bs-example-standalone"> <div class="alert alert-warning alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <strong>Holy guacamole!</strong> Best check yo self, you're not looking too good. </div> - </div><!-- /example --> - <div class="bs-example"> <div class="alert alert-danger alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4>Oh snap! You got an error!</h4> @@ -24,21 +22,25 @@ <h2 id="alerts-usage">Usage</h2> - <p>Enable dismissal of an alert via JavaScript:</p> - {% highlight js %}$(".alert").alert(){% endhighlight %} - <h3>Markup</h3> <p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality.</p> - {% highlight html %}<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>{% endhighlight %} + +{% highlight html %} +<button type="button" class="close" data-dismiss="alert"> + <span aria-hidden="true">×</span> + <span class="sr-only">Close</span> +</button> +{% endhighlight %} + + <p>To have your alerts use animation when closing, make sure they have the <code>.fade</code> and <code>.in</code> class already applied to them.</p> <h3>Methods</h3> <h4>$().alert()</h4> - <p>Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the <code>.fade</code> and <code>.in</code> class already applied to them.</p> + <p>Makes an alert listen for click events on descendant elements which have the <code>data-dismiss="alert"</code> attribute. (Not necessary when using the data-api's auto-initialization.)</p> - <h4>.alert('close')</h4> + <h4>$().alert('close')</h4> <p>Closes an alert.</p> - {% highlight js %}$(".alert").alert('close'){% endhighlight %} <h3>Events</h3> @@ -64,7 +66,7 @@ </table> </div><!-- /.table-responsive --> {% highlight js %} -$('#my-alert').on('closed.bs.alert', function () { +$('#myAlert').on('closed.bs.alert', function () { // do something… }) {% endhighlight %} |
