I ve tried:
$("#el1").fadeOut();
$("#el2").fadeIn();
但是,我可以同时在屏幕上有两个内容,第一个内容必须完全隐藏在第二个内容可以消失之前,这样就没有工作了。
我还尝试:
$("#el1").fadeOut(function() {
$("#el2").fadeIn();
});
which seems to work ok but the problem is that when the states (this animation is from a link click) are toggled quickly while animating, you can get a case where both end up visible.
I ve also tried .stop()
but it didn t seem to help either.
How can I get the behaviour I need with jQuery, so that only the last clicked link is visible, not any of the others, and only one at a time.