' +
'
' +
'
' +
'
![]()
' +
'
' +
'
' +
'
![]()
' +
'
' +
'
' +
'
![]()
' +
'
' +
'
‹' +
'
›' +
'
'
var $html = $(html)
$html
.appendTo('#qunit-fixture')
.bootstrapCarousel()
var $firstItem = $('#firstItem')
setTimeout(function () {
assert.ok($firstItem.hasClass('active'))
$html
.bootstrapCarousel('dispose')
.attr('style', 'visibility: hidden;')
.bootstrapCarousel()
setTimeout(function () {
assert.ok($firstItem.hasClass('active'))
done()
}, 80)
}, 80)
})
QUnit.test('Should not go to the next item when the parent of the carousel is not visible', function (assert) {
assert.expect(2)
var done = assert.async()
var html = '
' +
'
' +
'
' +
'
' +
'
![]()
' +
'
' +
'
' +
'
![]()
' +
'
' +
'
' +
'
![]()
' +
'
' +
'
‹' +
'
›' +
'
' +
'
'
var $html = $(html)
$html.appendTo('#qunit-fixture')
var $parent = $html.find('#parent')
var $carousel = $html.find('#myCarousel')
$carousel.bootstrapCarousel()
var $firstItem = $('#firstItem')
setTimeout(function () {
assert.ok($firstItem.hasClass('active'))
$carousel.bootstrapCarousel('dispose')
$parent.attr('style', 'visibility: hidden;')
$carousel.bootstrapCarousel()
setTimeout(function () {
assert.ok($firstItem.hasClass('active'))
done()
}, 80)
}, 80)
})
})