aboutsummaryrefslogtreecommitdiff
path: root/site
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2018-03-03 23:04:11 +0200
committerXhmikosR <[email protected]>2018-10-20 15:32:09 +0300
commitcaefd7046372e954d21550bbdadcabf98b2a86f0 (patch)
tree9e1835a7d61a8302c4dcaaff5b5a023efcae96b1 /site
parentbf573896472c83e2b85b52f6cbf606765b73cb3e (diff)
downloadbootstrap-caefd7046372e954d21550bbdadcabf98b2a86f0.tar.xz
bootstrap-caefd7046372e954d21550bbdadcabf98b2a86f0.zip
Add touch support in our carousel with HammerJS.
Diffstat (limited to 'site')
-rw-r--r--site/_includes/scripts.html1
-rw-r--r--site/docs/4.1/components/carousel.md8
-rw-r--r--site/docs/4.1/getting-started/contents.md2
-rw-r--r--site/docs/4.1/getting-started/introduction.md2
4 files changed, 11 insertions, 2 deletions
diff --git a/site/_includes/scripts.html b/site/_includes/scripts.html
index 74d6f9ef2..dfbf3f250 100644
--- a/site/_includes/scripts.html
+++ b/site/_includes/scripts.html
@@ -1,5 +1,6 @@
<script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="{{ site.baseurl }}/assets/js/vendor/jquery-slim.min.js"><\/script>')</script>
+<script src="{{ site.cdn.hammer }}"{% if site.github %} integrity="{{ site.cdn.hammer_hash }}" crossorigin="anonymous"{% endif %}></script>
{%- if jekyll.environment == "production" -%}
<script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ site.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
diff --git a/site/docs/4.1/components/carousel.md b/site/docs/4.1/components/carousel.md
index 543b06430..6bfb35206 100644
--- a/site/docs/4.1/components/carousel.md
+++ b/site/docs/4.1/components/carousel.md
@@ -12,6 +12,8 @@ The carousel is a slideshow for cycling through a series of content, built with
In browsers where the [Page Visibility API](https://www.w3.org/TR/page-visibility/) is supported, the carousel will avoid sliding when the webpage is not visible to the user (such as when the browser tab is inactive, the browser window is minimized, etc.).
+The carousel supports swipe gestures (left and right) using [HammerJS]({{ site.cdn.hammer }}). For this to function correctly you need to include HammerJS before Bootstrap or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains HammerJS.
+
Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.
Lastly, if you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
@@ -281,6 +283,12 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
<td>true</td>
<td>Whether the carousel should cycle continuously or have hard stops.</td>
</tr>
+ <tr>
+ <td>touch</td>
+ <td>boolean</td>
+ <td>true</td>
+ <td>Whether the carousel should handle touch event and allow swipe left/right.</td>
+ </tr>
</tbody>
</table>
diff --git a/site/docs/4.1/getting-started/contents.md b/site/docs/4.1/getting-started/contents.md
index fd38e2fba..0c210d043 100644
--- a/site/docs/4.1/getting-started/contents.md
+++ b/site/docs/4.1/getting-started/contents.md
@@ -38,7 +38,7 @@ bootstrap/
└── bootstrap.min.js.map
{% endhighlight %}
-This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/).
+This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/) and [HammerJS](https://hammerjs.github.io/), but not [jQuery](https://jquery.com/).
## CSS files
diff --git a/site/docs/4.1/getting-started/introduction.md b/site/docs/4.1/getting-started/introduction.md
index 55ced2f9c..0ad797301 100644
--- a/site/docs/4.1/getting-started/introduction.md
+++ b/site/docs/4.1/getting-started/introduction.md
@@ -37,7 +37,7 @@ We use [jQuery's slim build](https://blog.jquery.com/2016/06/09/jquery-3-0-final
Curious which components explicitly require jQuery, our JS, and Popper.js? Click the show components link below. If you're at all unsure about the general page structure, keep reading for an example page template.
-Our `bootstrap.bundle.js` and `bootstrap.bundle.min.js` include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/). For more information about what's included in Bootstrap, please see our [contents]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#precompiled-bootstrap) section.
+Our `bootstrap.bundle.js` and `bootstrap.bundle.min.js` include [Popper](https://popper.js.org/) and [HammerJS](https://hammerjs.github.io/), but not [jQuery](https://jquery.com/). For more information about what's included in Bootstrap, please see our [contents]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#precompiled-bootstrap) section.
<details>
<summary class="text-primary mb-3">Show components requiring JavaScript</summary>