gpt4 book ai didi

jquery ui css 不能离线工作

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

我正在使用 JQuery UI Accordion,它与在线导入完美配合

jquery-ui.css, jquery-1.9.1.js and jquery-ui.js

但是,如果我在导入中使用我下载的文件,则 jquery.ui.css 无法正常工作。

我的代码是:

<html>
<head>
<title>Demo Monitoring</title>
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css">
<script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
<!-- <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>-->

<script>
$(document).ready(function() {
var icons = {
header: "ui-icon-circle-arrow-e",
activeHeader: "ui-icon-circle-arrow-s"
};
$('#acc_main').accordion({
active: false,
collapsible: true,
heightStyle: "content"
});
$("#acc_child").accordion({
active: false,
collapsible: true,
heightStyle: "content",
icons: icons
});
});
</script>
<style>
h3{
text-align: center;
}
</style>
</head>
<body>
<div id="acc_main">
<h3>Main Section</h3>
<div id="acc_child">
<h3>Section 1</h3>
<div>
1st section
</div>
<h3>Section 2</h3>
<div>
2nd section
</div>
<h3>Section 3</h3>
<div>
List :
<ul>
<li>List item one</li>
<li>List item two</li>
<li>List item three</li>
</ul>
</div>
</div>
</div>
</body>

本地导入的输出:

Output

我的元素层次结构:

Project

最佳答案

可能是您的 css 文件路径不正确。尝试将 href="css/jquery-ui.css"替换为 href="/css/jquery-ui.css"

开头有斜线表示文件夹在根目录,没有斜线表示css文件夹是相对于当前页面

关于jquery ui css 不能离线工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20949759/

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