【发布时间】:2011-01-01 05:31:50
【问题描述】:
我有这个非常基本的标签块:
$('.tabbed-section .panel').hide();
$('.tabbed-section .panel:first').show();
$('.tabbed-section .tabs li:first').addClass('active');
$('.tabbed-section .tabs li a').click(function () {
$('.tabbed-section .tabs li').removeClass('active');
$(this).parent().addClass('active');
var currentTab = $(this).attr('href');
var tab_id = $(this).attr('href');
$(this).closest('#hero').attr('class', 'clear ' + tab_id.replace('#', ''));
$('.tabbed-section .panel').hide();
$(currentTab).show();
return false;
});
.. 效果很好,但我可以在活动选项卡更改时添加淡入淡出效果吗?我认为它有一个插件(innerfade),但我想尽可能避免使用另一个插件。
另外,上面的jQuery可以进一步压缩吗?
感谢您的帮助!
【问题讨论】:
标签: jquery tabs fade effect minify