0

We can write a single line of code only if the animation functions are same, like animate( {top: "50px", opacity: 0} ), but how do you perform the animations simultaneously if the animation functions are different, say slide up and animate( {top: "50px"} )?

1

1 Answer 1

2

When calling to .animate() set the queue value to false, which will cause all animations to run at the same time.

$('div').animate({ opacity: 0.25, height: '400px', }, { queue: false, duration: 5000 }).animate({ width: '500px' }, { queue: false, duration: 5000 }); 

Example on jsfiddle

Sign up to request clarification or add additional context in comments.

2 Comments

basically I want to use fadeIn and animate so that the element fades into the screen as well as move mhrizontally for which I may change its left position or the margin. I cant seem to get it going... can we specify queue: false in the fadeIn effect also... if we can kindly tell the syntax as I am already using is but cannot get it to work....
Simply use .animate() instead of fadeIn() e.g. .animate({ "opacity": "show"},{queue:false, duration:"slow"});

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.