IDがすでに選択されている場合、次のコードを実行するのを止めるにはどうすればよいですか?既にタブが選択されている場合にonclickイベントを停止する
ご協力いただければ幸いです。
//Product Tabs
$('#productinfowrap .tab:first').show();
$('#subselect li').click(function() {
var thisTop = $(this).position().top;
$('#subselect li').removeClass('current');
var li = (this);
$('.pointer').animate({'top': thisTop}, function() {
$(li).addClass('current');
});
var id = $(this).find("a").attr('href');
$("#productinfowrap > div").fadeOut(500).hide();
$(id).fadeIn();
return false;
});
とHTML
<ul id="subselect">
<li class="current"><a href="#overview">Overview</a><span class="pointer"></span></li>
<li><a href="#applications">Applications</a></li>
<li><a href="#technical">Technical</a></li>
</ul>
私は、これは残念ながらそれはすべての場合に役立ちます? – Andy