1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

Merge branch 'delegate-api-to-document' of git://github.com/badcarl/bootstrap into badcarl-delegate-api-to-document

Conflicts:
	js/bootstrap-carousel.js
This commit is contained in:
Jacob Thornton
2012-10-17 23:05:16 -07:00
18 changed files with 130 additions and 181 deletions

View File

@@ -165,14 +165,12 @@
/* CAROUSEL DATA-API
* ================= */
$(function () {
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = !$target.data('carousel') && $.extend({}, $target.data(), $this.data())
$target.carousel(options)
e.preventDefault()
})
$(document).on('click.carousel.data-api', '[data-slide]', function (e) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = !$target.data('carousel') && $.extend({}, $target.data(), $this.data())
$target.carousel(options)
e.preventDefault()
})
}(window.jQuery);