1
當我在頁面上有一組以上的選項卡時,此插件會中斷,只有第一組選項卡可以工作。如果有多個插件,那麼opencart的jQuery插件選項卡不起作用
$.fn.tabs = function() {
var selector = this;
this.each(function() {
var obj = $(this);
$(obj.attr('href')).hide();
$(obj).click(function() {
$(selector).removeClass('selected');
$(selector).each(function(i, element) {
$($(element).attr('href')).hide();
});
$(this).addClass('selected');
$($(this).attr('href')).show();
return false;
});
});
$(this).show();
$(this).first().click();
};
JS Fiddle example顯示它不工作。