Lets say I got this little span
that I can't modify from its structure or give any surrounding elements.(可以说我得到了一个很小的span
,无法从其结构中修改或提供任何周围的元素。)
It is like it is.(就是这样。) But now I want to display another Text in it and I want them to toggle between each other.(但是现在我想在其中显示另一个文本,并且希望它们之间切换。)
Example: First text stays for 1 seconds -> it gets faded out and the other text will be displayed -> repeat to infinity.(示例:第一个文本停留1秒钟->淡出,然后显示其他文本->重复至无穷大。)
Is it possible to archive this with just the toggle() function?(是否可以仅使用toggle()函数将其存档?) I tried around a bit but nothing really works.(我尝试了一下,但没有任何效果。)
$(function() { $('#test').delay(1000).fadeOut(750, function() { $(this).text('Some other text!').fadeIn(500); }); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <span id="test">This Text!</span>
ask by Bill Bronson translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…