如何使外观滚动然后直接转到#link而不是直接转到#link?

时间:2015-06-03 19:08:46

标签: javascript html css

当我点击“产品”链接时,突然它会指向#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>

1 个答案:

答案 0 :(得分:1)

您所引用的页面使用Arbitrary Anchor,它可以完成您的要求。