Javascript 2 Java脚本问题
看起来您在tabs代码块的第2行忽略了$operator。这肯定是个错误Javascript 2 Java脚本问题,javascript,jquery,Javascript,Jquery,看起来您在tabs代码块的第2行忽略了$operator。这肯定是个错误 $('#tabs div').hide(); ('#tabs div:first').show(); $('#tabs ul li:first').addClass('active'); $('#tabs ul li a').click(function() { $('#tabs ul li').removeClass('active'); $(this).parent().addClass('active');
$('#tabs div').hide();
('#tabs div:first').show();
$('#tabs ul li:first').addClass('active');
$('#tabs ul li a').click(function()
{
$('#tabs ul li').removeClass('active');
$(this).parent().addClass('active');
var currentTab = $(this).attr('href');
$('#tabs div').hide();
$(currentTab).show();
return false;
});
应该是
('#tabs div:first').show();
您的选项卡中缺少的
$
是否是一个输入错误?很抱歉出错。$存在于ma代码中。我在复制它时错过了它。$现在是运算符,实际上它是一个函数。\很抱歉出错。$在ma代码中退出。我在复制它时错过了它。我注意到$('#tabs div').hide();也在隐藏着星星。。我如何防止它隐藏它。
('#tabs div:first').show();
$('#tabs div:first').show();