Chiggins
Chiggins

Reputation: 8397

jQuery slideToggle() on two items concurrently

So I'm in the process of creating a text slider, for headlines. I would like the currently displayed text to side out, at the same time that the new text is sliding in. Is there a way that I can use jQuerys .slideToggle() or .slide() concurrently to be able to do what I want?

Upvotes: 1

Views: 287

Answers (2)

Anand
Anand

Reputation: 729

Call the slideToggle function on both objects one after the other. The transition will happen concurrently.

$("#obj1").slideToggle();
$("#obj2").slideToggle();

Upvotes: 3

SLaks
SLaks

Reputation: 887453

You can create a new element for the new text, position it over the old element, then slideToggle() both of them.

Upvotes: 0

Related Questions