开发者

jQuery slideToggle() on two items concurrently

开发者 https://www.devze.com 2023-01-26 00:18 出处:网络
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

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();


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

0

精彩评论

暂无评论...
验证码 换一张
取 消