1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 05:19:15 +02:00

Merge branch '2.3.0-wip' of github.com:twitter/bootstrap into 2.3.0-wip

This commit is contained in:
Mark Otto
2012-12-26 09:21:34 -06:00
16 changed files with 332 additions and 144 deletions

View File

@@ -188,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()
})