Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 平滑滚动不使其锚定_Javascript_Html_Jquery_Css_Smooth Scrolling - Fatal编程技术网

Javascript 平滑滚动不使其锚定

Javascript 平滑滚动不使其锚定,javascript,html,jquery,css,smooth-scrolling,Javascript,Html,Jquery,Css,Smooth Scrolling,我目前正在使用smooth scroll开发一个单页网站。目前,我可以从页面顶部滚动到每个单独的部分,但是当我在“团队”部分并尝试转到“关于”部分时,页面不会一直滚动到锚。当我尝试从“关于”部分滚动到“团队”部分时,页面只会滚动到顶部。我也在使用引导v4。我做错了什么 以下是我获得smoothscroll javascript的页面链接: 这是html标记: 这是我的索引文件的一部分: <div class="d-flex toggled" id="wrapp

我目前正在使用smooth scroll开发一个单页网站。目前,我可以从页面顶部滚动到每个单独的部分,但是当我在“团队”部分并尝试转到“关于”部分时,页面不会一直滚动到锚。当我尝试从“关于”部分滚动到“团队”部分时,页面只会滚动到顶部。我也在使用引导v4。我做错了什么

以下是我获得smoothscroll javascript的页面链接:

这是html标记:

这是我的索引文件的一部分:

<div class="d-flex toggled" id="wrapper">
      <?php require 'sidebar.php'; ?>
  <div id="page-content-wrapper">
      <nav class="navbar-inverse">
          <button class="btn btn-lg menu-toggle" id="menu-toggle">
              <i class="fas fa-bars"></i>
          </button>
      </nav>
        <?php require 'carousel.php'; ?>
        <?php require 'team.php'; ?>
      <hr style="clear: both;"/>
        <?php require 'about.php'; ?>
      <hr style="clear: both;"/>
  </div>
希望这些信息足以让您了解我的问题所在。 提前谢谢

<div class="container-fluid h-50 page-section">
  <a class="section-link" name="team"></a>
<div class="row section-title">
<div class="container-fluid h-50 page-section">
  <a class="section-link" name="about"></a>
<div class="row section-title">
html {
  scroll-behavior: smooth;
  height: 100%;
  display: block;
}

.page-section {
  text-align: center;
  position: relative !important;
  margin: 5rem;

}

.section-link {
  width: 100%;
  height: 1px;
  position: relative;
  margin-top: 100px;
}