diff options
| author | hillai <[email protected]> | 2014-11-14 17:09:50 +0200 |
|---|---|---|
| committer | hillai <[email protected]> | 2014-11-16 16:48:08 +0200 |
| commit | 0ada807ce6b99b95ce159a6b236309ab0ac425b3 (patch) | |
| tree | d098f675a89bf72cc5c7e513afb0121e8a86ba88 /docs | |
| parent | a7682e3fde01e2b5e7c12cea10ca2d4251f73e69 (diff) | |
| download | bootstrap-0ada807ce6b99b95ce159a6b236309ab0ac425b3.tar.xz bootstrap-0ada807ce6b99b95ce159a6b236309ab0ac425b3.zip | |
Add modal autofocus example
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/_includes/js/modal.html | 7 |
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> |
