0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
This commit is contained in:
fat 2013-07-17 21:08:50 -07:00
parent 0f64c21049
commit eb3333a612
4 changed files with 11 additions and 10 deletions

View File

@ -437,12 +437,13 @@
var $this = $(this), href
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var options = $.extend({}, $target.data(), $this.data())
var slideIndex
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
$target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('bs.carousel').pause().to(slideIndex).cycle()
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
@ -612,8 +613,7 @@
var parent = $this.attr('data-parent')
var $parent = parent && $(parent)
console.log(data, data && data.transitioning)
if (data && !data.transitioning) {
if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
}

File diff suppressed because one or more lines are too long

View File

@ -279,7 +279,7 @@ body {
</ol>
<div class="carousel-inner">
<div class="item active">
<img data-src="holder.js/1500x500/auto/#777:#7a7a7a/text:First slide" alt="">
<img data-src="holder.js/1500x500/auto/#F00:#7a7a7a/text:First slide" alt="">
<div class="container">
<div class="carousel-caption">
<h1>Example headline.</h1>
@ -289,7 +289,7 @@ body {
</div>
</div>
<div class="item">
<img data-src="holder.js/1500x500/auto/#777:#7a7a7a/text:Second slide" alt="">
<img data-src="holder.js/1500x500/auto/#0F0:#7a7a7a/text:Second slide" alt="">
<div class="container">
<div class="carousel-caption">
<h1>Another example headline.</h1>
@ -299,7 +299,7 @@ body {
</div>
</div>
<div class="item">
<img data-src="holder.js/1500x500/auto/#777:#7a7a7a/text:Third slide" alt="">
<img data-src="holder.js/1500x500/auto/#00F:#7a7a7a/text:Third slide" alt="">
<div class="container">
<div class="carousel-caption">
<h1>One more for good measure.</h1>

View File

@ -189,12 +189,13 @@
var $this = $(this), href
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var options = $.extend({}, $target.data(), $this.data())
var slideIndex
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
$target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('bs.carousel').pause().to(slideIndex).cycle()
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()