max
max

Reputation: 8687

How to combine slideDown/slideUp animations with other properties using Velocity.js

I'm using Velocity.js to animate different things on my site.

I'm able to set slideDown/slideUp animation to my elements, but I would like to combine it with scale animation.

Example:

$('#myelement').velocity({scale: 0});
$('#myelement').velocity('slideUp');

CODEPEN

I don't really know how to connect this two animations to begin simultaneously.

Upvotes: 0

Views: 1594

Answers (1)

max
max

Reputation: 8687

I found queue option in Velocity.js documentation.

You can set queue to false to force a new animation call to immediately run in parallel with any currenty-active animations.

$('#trigger').click(function() {
  $('#myelement').velocity({
    scale: 0
  }, {
    queue: false
  });
  $('#myelement').velocity('slideUp');
});

CODEPEN

Upvotes: 2

Related Questions