[英]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? 我希望将当前显示的文本移出,同时将新文本插入。有没有一种方法可以同时使用jQuerys
.slideToggle()
或.slide()
来执行我想要的操作?
Call the slideToggle function on both objects one after the other. 依次在两个对象上调用slideToggle函数。 The transition will happen concurrently.
过渡将同时发生。
$("#obj1").slideToggle();
$("#obj2").slideToggle();
您可以为新文本创建一个新元素,将其放置在旧元素上,然后将它们都设置为slideToggle()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.