aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorHeinrich Fenkart <[email protected]>2014-07-17 04:11:21 +0200
committerHeinrich Fenkart <[email protected]>2014-07-17 05:16:34 +0200
commit31772677f959bf449fee2a57805da66476d8eec8 (patch)
treeda049ec96a59cd05476c2291f8649be476f842ad /docs
parentf9349f36dfbfda7bf755f458d856d45d07745f29 (diff)
downloadbootstrap-31772677f959bf449fee2a57805da66476d8eec8.tar.xz
bootstrap-31772677f959bf449fee2a57805da66476d8eec8.zip
Clean up the Alert documentation
Diffstat (limited to 'docs')
-rw-r--r--docs/_includes/js/alerts.html20
1 files changed, 12 insertions, 8 deletions
diff --git a/docs/_includes/js/alerts.html b/docs/_includes/js/alerts.html
index e9cb8c871..5b7f4e10c 100644
--- a/docs/_includes/js/alerts.html
+++ b/docs/_includes/js/alerts.html
@@ -24,21 +24,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">&times;</span><span class="sr-only">Close</span></button>{% endhighlight %}
+
+{% highlight html %}
+<button type="button" class="close" data-dismiss="alert">
+ <span aria-hidden="true">&times;</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 +68,7 @@
</table>
</div><!-- /.table-responsive -->
{% highlight js %}
-$('#my-alert').on('closed.bs.alert', function () {
+$('#myAlert').on('closed.bs.alert', function () {
// do something…
})
{% endhighlight %}