测试主页

main
pqjepwfgk 5 months ago
parent 9f7d0f1053
commit f42bef9f9e

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>书城</title>
<link rel="stylesheet" href="css/stylesheets.css" />
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
/* body{
background-color: #e5e5e5;
} */
.top{
z-index: 999;
border-style: solid;
border-width: 1px;
border-color: #555;
height: 80px;
width: 100%;
position: fixed;
top: 0;
left: 0;
background-color: #1AA093;
text-align: center;
}
p{
font-size: 25px;
color: #e5e5e5;
}
</style>
</head>
<body>
<div class="top">
<nav class="topText"><p>Arknights</p></nav>
<nav class="log"><a href="Login.html"><p >登录</p></a></nav>
<nav class="sign"><a href="#"><p>注册</p></a></nav>
</div>
<div class="seach">
<nav class="logo"></nav>
<ul class = "searchNav">
<li><a href=""><p>首页</p></a></li>
<li><a href=""><p>推荐</p></a></li>
<li><a href=""><p>购物车</p></a></li>
<li><a href=""><p>个人信息</p></a></li>
</ul>
<nav class = "find">
<input type="text" name="seach" class = "my-input">
<button onclick="findBooks()" class = "findbooks"><p>查找</p></button>
</nav>
</div>
<div class = "mainBody">
<p>这是一行字</p>
</div>
<footer>
<p>版权所有,侵权必究</p>
</footer>
</body>
<script>
let name;
function findBooks(){
name = document.querySelector('.my-input').value;
$.getJSON("js/Info.json",function(data){
for(i in data.Title){
if(data.Title[i].includes(name,0)){
console.log(data.Title[i]);
console.log(data.Price[i]);
console.log(data.Picture[i]);
}
}
})
}
</script>
</html>
Loading…
Cancel
Save