From 784a95d94598301a35a89a591a426438cace96a7 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 10 Feb 2014 21:34:05 -0800 Subject: Documents #10140 --- docs/javascript.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 16cd66e65..1d2a980ae 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -1094,6 +1094,8 @@ $('#myTooltip').on('hidden.bs.tooltip', function () { {% endhighlight %} + +
@@ -1160,8 +1162,11 @@ $('#myTooltip').on('hidden.bs.tooltip', function () {

Live demo

- Click to toggle popover +
+{% highlight html %} + +{% endhighlight %} + +

Dismiss on next click

+

Use the focus trigger to dismiss popovers on their next click.

+
+
+{% highlight html %} +
{% highlight html %} - {% endhighlight %}

Four directions

@@ -1214,10 +1214,10 @@ sagittis lacus vel augue laoreet rutrum faucibus.">

Dismiss on next click

Use the focus trigger to dismiss popovers on their next click.

-
{% highlight html %} - {% endhighlight %} {% highlight js %} $('.popover-dismiss').popover({ -- cgit v1.2.3 From 4d870af2aad36563883ac5751f52d9f0288a0673 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 9 Mar 2014 15:19:26 -0700 Subject: Fixes #12487: Document required use of position relative for scrollspy --- docs/javascript.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index 48e07485a..d3eeeb5c2 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -665,8 +665,16 @@ $('#myDropdown').on('show.bs.dropdown', function () {

Usage

+

Requires relative positioning

+

No matter the implementation method, scrollspy requires the use of position: absolute; on the element you're spying on. In most cases this is the <body>.

+

Via data attributes

To easily add scrollspy behavior to your topbar navigation, add data-spy="scroll" to the element you want to spy on (most typically this would be the <body>). Then add the data-target attribute with the ID or class of the parent element of any Bootstrap .nav component.

+{% highlight css %} +body { + position: relative; +} +{% endhighlight %} {% highlight html %} ... @@ -680,7 +688,7 @@ $('#myDropdown').on('show.bs.dropdown', function () { {% endhighlight %}

Via JavaScript

-

Call the scrollspy via JavaScript:

+

After adding position: relative; in your CSS, call the scrollspy via JavaScript:

{% highlight js %} $('body').scrollspy({ target: '.navbar-example' }) {% endhighlight %} -- cgit v1.2.3 From aacafb2d5c28460477311e92de4de8ac88b2461a Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 9 Mar 2014 16:03:46 -0700 Subject: Fixes #12892: Link to one of the SO articles on Bootstrap modals and YouTube --- docs/javascript.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs/javascript.html') diff --git a/docs/javascript.html b/docs/javascript.html index d3eeeb5c2..798ac1110 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -231,13 +231,17 @@ $('#myModal').on('show.bs.modal', function (e) { {% endhighlight %} -

Make modals accessible

Be sure to add role="dialog" to .modal, aria-labelledby="myModalLabel" attribute to reference the modal title, and aria-hidden="true" to tell assistive technologies to skip the modal's DOM elements.

Additionally, you may give a description of your modal dialog with aria-describedby on .modal.

+
+

Embedding YouTube videos

+

Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. See this helpful Stack Overflow post for more information.

+
+

Optional sizes

Modals have two optional sizes, available via modifier classes to be placed on a .modal-dialog.

-- cgit v1.2.3