aboutsummaryrefslogtreecommitdiff
path: root/docs/_includes
diff options
context:
space:
mode:
authorhillai <[email protected]>2014-11-14 17:09:50 +0200
committerhillai <[email protected]>2014-11-16 16:48:08 +0200
commit0ada807ce6b99b95ce159a6b236309ab0ac425b3 (patch)
treed098f675a89bf72cc5c7e513afb0121e8a86ba88 /docs/_includes
parenta7682e3fde01e2b5e7c12cea10ca2d4251f73e69 (diff)
downloadbootstrap-0ada807ce6b99b95ce159a6b236309ab0ac425b3.tar.xz
bootstrap-0ada807ce6b99b95ce159a6b236309ab0ac425b3.zip
Add modal autofocus example
Diffstat (limited to 'docs/_includes')
-rw-r--r--docs/_includes/js/modal.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/_includes/js/modal.html b/docs/_includes/js/modal.html
index 993b72103..e2ed1918e 100644
--- a/docs/_includes/js/modal.html
+++ b/docs/_includes/js/modal.html
@@ -15,7 +15,12 @@
<p>There are some caveats regarding using modals on mobile devices. <a href="../getting-started/#support-fixed-position-keyboards">See our browser support docs</a> for details.</p>
</div>
- <p><strong class="text-danger">Due to how HTML5 defines its semantics, the <code>autofocus</code> HTML attribute has no effect in Bootstrap modals.</strong></p>
+ <p><strong class="text-danger">Due to how HTML5 defines its semantics, the <code>autofocus</code> HTML attribute has no effect in Bootstrap modals.</strong> To achieve the same effect, use some custom JavaScript:</p>
+ {% highlight js %}
+ $('#myModal').on('shown.bs.modal', function () {
+ $('#myInput').focus()
+ })
+ {% endhighlight %}
<h2 id="modals-examples">Examples</h2>