gpt4 book ai didi

javascript - 我怎样才能使外观滚动然后直接转到#link 而不是直接转到#link?

转载 作者:行者123 更新时间:2023-11-28 17:04:18 28 4
gpt4 key购买 nike

当我点击“产品”链接时,它突然指向#link。我怎样才能使它的外观看起来像滚动然后转到产品?请帮帮我。

<!DOCTYPE html>
<html >
<head>
<title>vStudy</title>
<script>
function big(x){
x.style.color = "red";
x.style.fontSize = "17px";
}
function small(x){
x.style.color = "white";
x.style.fontSize ="15px";
}

</script>
<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
<link rel= "stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
</head>
<body >
<img src="tree.jpg" width="1340px"style="position:absolute;top:0px;height:655px">
<img src="logo.gif" height="200" width="180px"style="position:absolute;top:265px;left:600px">
<div >
<div="logo1" style="position:fixed;z-index:100">
<div id="logo" style="width:1340px;height:125px;background-color:BLACK;opacity:0.7"></div>
<img src="logo3.gif" alt ="vstudy" "height="150px" width="130px" style="position:absolute;left:0px;top:8px">
<p>
<span class ="home" style ="position:absolute;left:150px;top:50px;font-weight:bolder;color:white;font-size:18px">Where things go cybernated...</span>
<span><a href="#" style="text-decoration:none;position:absolute;right:588px;top:50px;font-weight:bold;color:white;font-size:15px" onmouseover="big(this)" onmouseout="small(this)">HOME</a></span>
<span><a href="#" style="text-decoration:none;position:absolute;right:455px;top:50px;font-weight:bold;color:white;font-size:15px" onmouseover="big(this)" onmouseout="small(this)">OUR MISSION</a></span>
<span><a href="#products" style="text-decoration:none;position:absolute;right:250px;top:50px;font-weight:bold;color:white;font-size:15px" onmouseover="big(this)" onmouseout="small(this)">PRODUCTS & SERVICES</a></span>
<span><a href="#" style="text-decoration:none;position:absolute;right:145px;top:50px;font-weight:bold;color:white;font-size:15px" onmouseover="big(this)" onmouseout="small(this)">ABOUT US</a></span>
<span><a href="#" style="text-decoration:none;position:absolute;right:20px;top:50px;font-weight:bold;color:white;font-size:15px" onmouseover="big(this)" onmouseout="small(this)">CONTACT US</a></span>
</p>
</div>
</div>
<p id="products" style="position:absolute;top:655px;width:1340px;height:655px">
<h1 style="position:absolute;top:780px">
PRODUCTS & SERVICES </h1>
</body>
</html>

最佳答案

您所指的页面使用 Arbitrary Anchor ,它完成了您的要求。

关于javascript - 我怎样才能使外观滚动然后直接转到#link 而不是直接转到#link?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30628592/

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