aboutsummaryrefslogtreecommitdiff
path: root/docs/assets/js/bootstrap-carousel.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-01-13 04:26:52 -0800
committerMark Otto <[email protected]>2013-01-13 04:26:52 -0800
commit7d8d5c783815d83bddc6969052f1600c45246d57 (patch)
tree68378feaf630e4b670118b85dc7fb57501fcca9d /docs/assets/js/bootstrap-carousel.js
parent76ed6b0b2ced6a29c5cb7b6ea62d0c738dbbd90a (diff)
parent4b34f4947aedc0e8539eee779e3921f44e0bca8b (diff)
downloadbootstrap-7d8d5c783815d83bddc6969052f1600c45246d57.tar.xz
bootstrap-7d8d5c783815d83bddc6969052f1600c45246d57.zip
Merge branch '2.3.0-wip' into 3.0.0-wip
Conflicts: Makefile README.md component.json docs/assets/css/bootstrap-responsive.css docs/assets/css/bootstrap.css docs/assets/js/bootstrap-affix.js docs/assets/js/bootstrap-alert.js docs/assets/js/bootstrap-button.js docs/assets/js/bootstrap-carousel.js docs/assets/js/bootstrap-collapse.js docs/assets/js/bootstrap-dropdown.js docs/assets/js/bootstrap-modal.js docs/assets/js/bootstrap-popover.js docs/assets/js/bootstrap-scrollspy.js docs/assets/js/bootstrap-tab.js docs/assets/js/bootstrap-tooltip.js docs/assets/js/bootstrap-transition.js docs/assets/js/bootstrap-typeahead.js docs/assets/js/bootstrap.js docs/components.html docs/css.html docs/examples/fluid.html docs/extend.html docs/getting-started.html docs/index.html docs/templates/pages/base-css.mustache docs/templates/pages/components.mustache docs/templates/pages/extend.mustache docs/templates/pages/getting-started.mustache docs/templates/pages/index.mustache docs/templates/pages/javascript.mustache js/bootstrap-affix.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-tooltip.js js/bootstrap-transition.js js/bootstrap-typeahead.js less/bootstrap.less less/buttons.less less/forms.less less/navbar.less less/popovers.less less/responsive-767px-max.less less/responsive.less less/tables.less less/tooltip.less less/type.less less/variables.less package.json
Diffstat (limited to 'docs/assets/js/bootstrap-carousel.js')
-rw-r--r--docs/assets/js/bootstrap-carousel.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/docs/assets/js/bootstrap-carousel.js b/docs/assets/js/bootstrap-carousel.js
index d9c580e85..fad16def2 100644
--- a/docs/assets/js/bootstrap-carousel.js
+++ b/docs/assets/js/bootstrap-carousel.js
@@ -108,6 +108,7 @@
e = $.Event('slide', {
relatedTarget: $next[0]
+ , direction: direction
})
if ($next.hasClass('active')) return
@@ -187,11 +188,18 @@
/* CAROUSEL DATA-API
* ================= */
- $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
+ $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = $.extend({}, $target.data(), $this.data())
+ , slideIndex
+
$target.carousel(options)
+
+ if (slideIndex = $this.attr('data-slide-to')) {
+ $target.data('carousel').pause().to(slideIndex).cycle()
+ }
+
e.preventDefault()
})