if condition within animate

谁都会走 提交于 2019-12-25 02:29:23

问题


I am using the code from the folling link on mouseover function http://perplexed.co.uk/1991_jquery_scroll_tabs_like_browser_tabs.htm

i check the values of offset during mouseover and set the visibility prev and next button. But the checking always happens in the next mouseover . Eg: i have to set the next button to invisible during the same mouse over event when i scroll and reach the end. but it happens in the next mouseover.

Is it posiible to write an if function within the animate function


回答1:


Not sure what the problem is. I changed the script you used from 'click' to 'mouseover' and it just works. No need to add any if statement. Just change the .click parts like this:

$(".slider").off('mouseover', '.next').on('mouseover', '.next', function(){
...
}
$(".slider").off('mouseover', '.prev').on('mouseover', '.prev', function(){
...
}

Demonstration at jsFiddle



来源:https://stackoverflow.com/questions/17542353/if-condition-within-animate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!