私はこの非常に基本的なタブ付きブロックを持っています:
$('.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;
});
..うまく機能しますが、アクティブなタブが変更されたときにフェード効果を追加できますか? プラグイン(インナーフェード)があると思いますが、できれば別のプラグインの使用は避けたいです。
また、上記のjQueryをさらに圧縮できますか?
ご協力いただきありがとうございます!