开发者

Slide, Direction: left not working?

开发者 https://www.devze.com 2023-04-03 22:43 出处:网络
does anyone have any idea why this function is not working in Jquery? $(\'.left\').show(\"slide\", { direction: \"left\" }, 1000);

does anyone have any idea why this function is not working in Jquery?

$('.left').show("slide", { direction: "left" }, 1000);

I am trying to create a button that expands a container and shows a div when clicked. http://jsfiddle开发者_StackOverflow社区.net/pufamuf/wXyDq/14/ Thanks a lot everyone! :)


AFAIK, the easing effect you are using is only available in JQuery UI, or as a separate download, so you need to add a reference to that as well. Then the animation works.

EDIT: Looks like that's the problem:

"The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite." http://api.jquery.com/animate/

HTH.


I think you have got the syntax wrong for show function. You should probably use

$('.left').show();

It cannot be used with "slide", like the way you tried. Read the manual.

http://api.jquery.com/show/

0

精彩评论

暂无评论...
验证码 换一张
取 消