简体   繁体   中英

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?

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

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

您可以为新文本创建一个新元素,将其放置在旧元素上,然后将它们都设置为slideToggle()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM