gpt4 book ai didi

javascript - 使用 HTML 标签化 Java 脚本

转载 作者:行者123 更新时间:2023-11-28 00:06:45 25 4
gpt4 key购买 nike

我有一个选项卡java脚本,但没有默认页面。我想打开该网站以选择一个页面作为默认选项卡。

请帮助我

$(document).ready(function(){
$("#tabs a").on("click", function(e){
e.preventDefault();
var html = $(this).attr('href');
var htmlurl = 'html/'+html;

// update to the newest tab
$("#tabs a").removeClass("active");
$(this).addClass("active");

// set the new page content
$("#content-wrap").hide().load(htmlurl, function(){
$(this).fadeIn(400);
});
});
});

最佳答案

我似乎不清楚你的问题,但是这些行没有意义。

// update to the newest tab
$("#tabs a").removeClass("active");
$(this).addClass("active");

在这些行中,您引用 $("#tabs a") 并删除该类,并通过使用此语句再次添加该类。

关于javascript - 使用 HTML 标签化 Java 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31281143/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com