-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Carousel Sliding image disappear when you move the mouse while the slide effect happen #7005
Comments
What browser and OS, and versions thereof? |
I'm using Chrome v 24.0.1312.57 on windows, and I just tried this on chrome 24, Firefox 18 and Safari 6.02 on mac os x as well and it does the same. The above screenshot was taken from twitter bootstrap github page |
This issue was actually reported before in #6135 but it was ignored and closed without investigation (there even was a video that displays the glitch). I've hit that glitch myself and made a deeper inspection. Having On pause, the Let's analyze the code (read my comments): cycle: function (e) {
if (!e) this.paused = false
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
, pause: function (e) {
// Why the paused flag is not set when an event is being handled?
// The only use of this line is handling the 'mouseenter' event.
if (!e) this.paused = true
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
// The transition end handler is being called,
// but actually the transition does not stop here,
// and the 'trigger' will only call the corresponding handler.
// Continue reading to the handler code below...
this.$element.trigger($.support.transition.end)
// BTW, I could not understand why the following call is here...it evaluates to:
// 1. The 'paused' flag set to false ("if (!e) ").
// 2. The 'interval' assigned but immediately cleared later.
// So the only purpose is to set 'paused' to false within the 'pause' method?
// Looks very confusing.
this.cycle()
}
clearInterval(this.interval)
this.interval = null
return this
}
, slide: function (type, next) {
// ...
this.$element.one($.support.transition.end, function () {
// The transition of the next item may have not been finished by now
// because of the trigger call in the 'pause' method.
$next.removeClass([type, direction].join(' ')).addClass('active')
// The active item that is partially gone loses its 'display: block;' style and
// immediately gets 'display: none;' regardless of the transition state.
// This results in the described missing item before the end of animation.
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
})
// ... I could only solve the issue by patching the
There should be a more logical way of solving this nasty glitch but may require refactoring. Please, do not ignore and investigate. Thanks in advance. |
can't reproduce this on bootstrap 3… can you? |
ah - nevermind got it – ok i'll see what i can do. thanks! |
fixed in 3.0 |
Found this bug while trying to use carousel for my website.
To reproduce this issue please follow these steps.
this might be due to something in the css which gets applied to the carousal when mouse hover over or with the pause event.
Thanks
The text was updated successfully, but these errors were encountered: