I'm using jquery slideDown()
and slideUp()
to show a fixed gototop
link when the scroll bar height is more than 200px
.
Problem:
Link slide action mixed up in a fast mouse wheel up and down
. Because of 0.4 sec
running time of slide functions. I tried to define a visible flag
and complete functions
to prevent mixing. But not successful.
Scroll down in result block
to view the link and try a fast wheel up and down. If the result block has big height on your screen, please decrease the height to see the action.
impress: function () {
if ($(window).scrollTop() > this.MIN_SCROLL_HEIGHT
&& !this.buttonVisibleFlag)
{
this.button.slideDown(400, function() {
Blue.buttonVisibleFlag = true;
});
}
else if ($(window).scrollTop() <= this.MIN_SCROLL_HEIGHT
&& this.buttonVisibleFlag)
{
this.button.slideUp(400, function() {
Blue.buttonVisibleFlag = false;
});
}
}
Any ideas or help would be greatly appreciated.