我有这个非常基本的标签块:
$('.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可以进一步压缩吗?
谢谢你的帮助!