opencart的jQuery插件选项卡不';如果超过一个,则无法工作
当我在一个页面上有多个标签时,这个插件会中断,只有第一组标签可以工作opencart的jQuery插件选项卡不';如果超过一个,则无法工作,jquery,opencart,Jquery,Opencart,当我在一个页面上有多个标签时,这个插件会中断,只有第一组标签可以工作 $.fn.tabs = function() { var selector = this; this.each(function() { var obj = $(this); $(obj.attr('href')).hide(); $(obj).click(function() { $(selector).removeClass('selected'); $(s
$.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();
};
显示它不起作用 您需要像这样单独调用选项卡组
否则,它假定所有链接都属于同一个选项卡组,并将相应地显示/隐藏您需要像这样单独调用选项卡组 否则,它假定所有链接都属于同一选项卡组,并将相应地显示/隐藏