【发布时间】:2023-07-27 08:56:01
【问题描述】:
我编写了示例代码来制作 2 个新标签和趋势
$(function() {
$("#t1").click(function() {
$("#t2").removeClass("current");
$(this).addClass("current");
$("#newTrend").hide();
$("#newContent").show();
});
$("#t2").click(function() {
$("#t1").removeClass("current");
$(this).addClass("current");
$("#newContent").hide();
$("#newTrend").show();
});
});
代码运行良好,但我想在标签更改时添加淡入淡出效果
这是我在 jsfiddle 中的代码http://jsfiddle.net/Ta3Q4/
当我使用 .fadeOut() 和 .fadeIn() 而不是 .hide() 和 .show() 时
新标签和趋势标签同时显示,看这里http://jsfiddle.net/Ta3Q4/1/我的意思
那么如何在不同时显示两个标签的情况下进行淡入淡出呢?
【问题讨论】:
标签: jquery