문제

I use this line of code for changing the position of an ul to get the requested li in focus.

$('ul#scroll').stop().animate({'left': new_pos+'px'},
    {duration: 50, easing: "swing"});

I tried some Effects like smoothmove but I get an error, that this effect can not be applied to my object.

Linear or swing are too boring.

Which effect can I use for animating the position?

도움이 되었습니까?

해결책

To use easing effects other than swing and linear you'd need to include jQueryUI.

The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear.

http://api.jquery.com/animate

http://jqueryui.com/resources/demos/effect/easing.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top