Apply easing on jquery ui show?
Asked Answered
D

3

6

I'm trying to apply easing on a jquery ui show effect. Ideally the api would look something like this:

$(this).show('scale', {
  duration: 1000,
  easing: 'easeOutBounce', 
});

Currently the element is at display:none. I need to show it with the scaling effect and have an easing.

Do I have to separate the commands or is there something like this that would work?

Thanks.

Decumbent answered 16/4, 2011 at 23:15 Comment(0)
N
11

I've tested it on jsfiddle and works:

$('.div1').show('scale', {
  duration: 1000,
  easing: 'easeOutBounce', 
});​

http://jsfiddle.net/tenshimsm/AUM6d/1/

Natch answered 15/5, 2012 at 0:0 Comment(3)
This didn't work last year. Must have been an update on jquery's side. sweet in any case thanksDecumbent
Last year?! Ooooops! Didn't see it.Natch
Uncaught SyntaxError: Unexpected token ILLEGALHuntington
G
4

You need to remove comma (,) after easeOutBounce then it should work

$(this).show('scale', {
  duration: 1000,
  easing: 'easeOutBounce' 
});
Galaxy answered 15/5, 2012 at 0:7 Comment(1)
I still get Uncaught SyntaxError: Unexpected token ILLEGALHuntington
R
-1

Check firebug, when using code example it adds some hidden characters:

            jQuery('#search-container .fa-search').toggle('scale', {duration: 1000,easing: 'easeOutBounce'});​
            jQuery('#homepage-search').toggle('scale', {duration: 1000,easing: 'easeOutBounce'});​
Ruffianism answered 30/7, 2014 at 7:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.