我有一个jquery函数:
function getArrowScroll(dirX, dirY, ele)
{
return function()
{
arrowScroll(dirX, dirY, this, ele);
this.blur();
return false;
};
}
当用户将箭头向下按钮悬停时,它将自动滚动div内的内容:
if (settings.arrowScrollOnHover) {
arrowUp.bind( mouseover.jsp , getArrowScroll(0, -1, arrowUp));
arrowDown.bind( mouseover.jsp , getArrowScroll(0, 1, arrowDown));
}
When the scroll bar reach the bottom of div, jquery get more data from other page and add them to the div. At this point, mouseover.jsp
is lost control already because I reinitialize everything except getArrowScroll(). It will keep scrolling down continuously non-stop by executing getArrowScroll(0, 1, arrowDown)
. I need kill function getArrowScroll(0, 1, arrowDown) before reinitialize, or when
mouseleave.jsp
. If I put :
arrowDown.bind( mouseover.jsp ,
getArrowScroll(0, 1, arrowDown)).bind( mouseleave.jsp ,
getArrowScroll(0, 0, arrowDown));
it will still scrolling to bottom because getArrowScroll(0, 1, arrowDown) is still running, how to kill or stop function getArrowScroll()?