Clicking menu item doesn’t scroll down to section on page

Tags: , , ,



the website http://guldcat.com has a template installed with a menu at the top. But I can’t get the link to load the appropriate section on the page.. Anyone has an idea what can be wrong? It uses smoothscroll.js

If I click ‘team’ in the menu bar, nothing happens. It does not scroll to “team”..

Thanks for help!!

`       <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
            <li><a href="#home" class="smoothScroll">HOME</a></li>
            <li><a href="#gallery" class="smoothScroll">FOOD GALLERY</a></li>
            <li><a href="#menu" class="smoothScroll">SPECIAL MENU</a></li>
            <li><a href="#team" class="smoothScroll">CHEFS</a></li>
            <li><a href="#contact" class="smoothScroll">CONTACT</a></li>
        </ul>
    </div>`

will not send the link to

` <!-- team section -->
<section id="team" class="parallax-section">
<div class="container">
    <div class="row">
        <div class="col-md-offset-2 col-md-8 col-sm-12 text-center">
            <h1 class="heading">Meet Zentro chefs</h1>
            <hr>
        </div>
        <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.3s">
            <img src="images/team1.jpg" class="img-responsive center-block" alt="team img">
            <h4>Thanya</h4>
            <h3>Main Chef</h3>
        </div>
        <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.6s">
            <img src="images/team2.jpg" class="img-responsive center-block" alt="team img">
            <h4>Lynda</h4>
            <h3>Pizza Specialist</h3>
        </div>
        <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.9s">
            <img src="images/team3.jpg" class="img-responsive center-block" alt="team img">
            <h4>Jenny Ko</h4>
            <h3>New Baker</h3>
        </div>
    </div>
</div>
`

Answer

Here I found a solution for you just add the jquery code and you will be done

$(document).ready(function(){
  // Add smooth scrolling to all links
  $(".smoothScroll").on('click', function(event) {

    // Make sure this.hash has a value before overriding default behavior
    if (this.hash !== "") {
      // Prevent default anchor click behavior
      event.preventDefault();

      // Store hash
      var hash = this.hash;

      // Using jQuery's animate() method to add smooth page scroll
      // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
      $('html, body').animate({
        scrollTop: $(hash).offset().top
      }, 800, function(){
   
        // Add hash (#) to URL when done scrolling (default click behavior)
        window.location.hash = hash;
      });
    } // End if
  });
});
<!DOCTYPE html>
<html lang="en"><link type="text/css" id="dark-mode" rel="stylesheet" href=""><style type="text/css" id="dark-mode-custom-style"></style><head>
    <meta charset="utf-8">
    <title>Zentro</title>

    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
<!--

Template 2076 Zentro

http://www.tooplate.com/view/2076-zentro

-->
    <link rel="stylesheet" href="http://guldcat.com/css/bootstrap.min.css">
    <link rel="stylesheet" href="http://guldcat.com/css/animate.min.css">
    <link rel="stylesheet" href="http://guldcat.com/css/font-awesome.min.css">
    <link rel="stylesheet" href="http://guldcat.com/css/nivo-lightbox.css">
    <link rel="stylesheet" href="http://guldcat.com/css/nivo_themes/default/default.css">
    <link rel="stylesheet" href="http://guldcat.com/css/style.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet" type="text/css">
</head>
<body data-new-gr-c-s-check-loaded="14.993.0" data-gr-ext-installed="">

<!-- preloader section -->
<section class="preloader" style="display: none;">
    <div class="sk-spinner sk-spinner-pulse"></div>
</section>

<!-- navigation section -->
<section class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon icon-bar"></span>
                <span class="icon icon-bar"></span>
                <span class="icon icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand">ZENTRO</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#home" class="smoothScroll">HOME</a></li>
                <li><a href="#gallery" class="smoothScroll">FOOD GALLERY</a></li>
                <li><a href="#menu" class="smoothScroll">SPECIAL MENU</a></li>
                <li><a href="#team" class="smoothScroll">CHEFS</a></li>
                <li><a href="#contact" class="smoothScroll">CONTACT</a></li>
            </ul>
        </div>
    </div>
</section>


<!-- home section -->
<section id="home" class="parallax-section">
    <div class="container">
        <div class="row">
            <div class="col-md-12 col-sm-12">
                <h1>ZENTRO RESTAURANT</h1>
                <h2>CLEAN &amp; SIMPLE DESIGN</h2>
                <a href="#gallery" class="smoothScroll btn btn-default">LEARN MORE</a>
            </div>
        </div>
    </div>      
</section>


<!-- gallery section -->
<section id="gallery" class="parallax-section">
    <div class="container">
        <div class="row">
            <div class="col-md-offset-2 col-md-8 col-sm-12 text-center">
                <h1 class="heading">Food Gallery</h1>
                <hr>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.3s" style="visibility: hidden; animation-delay: 0.3s; animation-name: none;">
                <a href="images/gallery-img1.jpg" data-lightbox-gallery="zenda-gallery"><img src="images/gallery-img1.jpg" alt="gallery img"></a>
                <div>
                    <h3>Lemon-Rosemary Prawn</h3>
                    <span>Seafood / Shrimp / Lemon</span>
                </div>
                <a href="images/gallery-img2.jpg" data-lightbox-gallery="zenda-gallery"><img src="images/gallery-img2.jpg" alt="gallery img"></a>
                <div>
                    <h3>Lemon-Rosemary Vegetables</h3>
                    <span>Tomato / Rosemary / Lemon</span>
                </div>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.6s" style="visibility: hidden; animation-delay: 0.6s; animation-name: none;">
                <a href="images/gallery-img3.jpg" data-lightbox-gallery="zenda-gallery"><img src="images/gallery-img3.jpg" alt="gallery img"></a>
                <div>
                    <h3>Lemon-Rosemary Bakery</h3>
                    <span>Bread / Rosemary / Orange</span>
                </div>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.9s" style="visibility: hidden; animation-delay: 0.9s; animation-name: none;">
                <a href="images/gallery-img4.jpg" data-lightbox-gallery="zenda-gallery"><img src="images/gallery-img4.jpg" alt="gallery img"></a>
                <div>
                    <h3>Lemon-Rosemary Salad</h3>
                    <span>Chicken / Rosemary / Green</span>
                </div>
                <a href="images/gallery-img5.jpg" data-lightbox-gallery="zenda-gallery"><img src="images/gallery-img5.jpg" alt="gallery img"></a>
                <div>
                    <h3>Lemon-Rosemary Pizza</h3>
                    <span>Pasta / Rosemary / Green</span>
                </div>
            </div>
        </div>
    </div>
</section>


<!-- menu section -->
<section id="menu" class="parallax-section" style="background-position: 50% -407px;">
    <div class="container">
        <div class="row">
            <div class="col-md-offset-2 col-md-8 col-sm-12 text-center">
                <h1 class="heading">Special Menu</h1>
                <hr>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Lemon-Rosemary Vegetable ................ <span>$20.50</span></h4>
                <h5>Chicken / Rosemary / Lemon</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Lemon-Rosemary Meat ........................... <span>$30.50</span></h4>
                <h5>Meat / Rosemary / Lemon</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Lemon-Rosemary Pork ........................ <span>$40.75</span></h4>
                <h5>Pork / Tooplate / Lemon</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Orange-Rosemary Salad .......................... <span>$55.00</span></h4>
                <h5>Salad / Rosemary / Orange</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Lemon-Rosemary Squid ...................... <span>$65.00</span></h4>
                <h5>Squid / Rosemary / Lemon</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Orange-Rosemary Shrimp ........................ <span>$70.50</span></h4>
                <h5>Shrimp / Rosemary / Orange</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Lemon-Rosemary Prawn ................... <span>$110.75</span></h4>
                <h5>Chicken / Rosemary / Lemon</h5>
            </div>
            <div class="col-md-6 col-sm-6">
                <h4>Lemon-Rosemary Seafood ..................... <span>$220.50</span></h4>
                <h5>Seafood / Rosemary / Lemon</h5>
            </div>
        </div>
    </div>
</section>      


<!-- team section -->
<section id="team" class="parallax-section">
    <div class="container">
        <div class="row">
            <div class="col-md-offset-2 col-md-8 col-sm-12 text-center">
                <h1 class="heading">Meet Zentro chefs</h1>
                <hr>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.3s" style="visibility: hidden; animation-delay: 0.3s; animation-name: none;">
                <img src="http://guldcat.com/images/team1.jpg" class="img-responsive center-block" alt="team img">
                <h4>Thanya</h4>
                <h3>Main Chef</h3>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.6s" style="visibility: hidden; animation-delay: 0.6s; animation-name: none;">
                <img src="http://guldcat.com/images/team2.jpg" class="img-responsive center-block" alt="team img">
                <h4>Lynda</h4>
                <h3>Pizza Specialist</h3>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.9s" style="visibility: hidden; animation-delay: 0.9s; animation-name: none;">
                <img src="http://guldcat.com/images/team3.jpg" class="img-responsive center-block" alt="team img">
                <h4>Jenny Ko</h4>
                <h3>New Baker</h3>
            </div>
        </div>
    </div>
</section>


<!-- contact section -->
<section id="contact" class="parallax-section">
    <div class="container">
        <div class="row">
            <div class="col-md-offset-1 col-md-10 col-sm-12 text-center">
                <h1 class="heading">Contact Us</h1>
                <hr>
            </div>
            <div class="col-md-offset-1 col-md-10 col-sm-12 wow fadeIn" data-wow-delay="0.9s" style="visibility: hidden; animation-delay: 0.9s; animation-name: none;">
                <form action="#" method="post">
                    <div class="col-md-6 col-sm-6">
                        <input name="name" type="text" class="form-control" id="name" placeholder="Name">
                  </div>
                    <div class="col-md-6 col-sm-6">
                        <input name="email" type="email" class="form-control" id="email" placeholder="Email">
                  </div>
                    <div class="col-md-12 col-sm-12">
                        <textarea name="message" rows="8" class="form-control" id="message" placeholder="Message"></textarea>
                    </div>
                    <div class="col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6">
                        <input name="submit" type="submit" class="form-control" id="submit" value="make a reservation">
                    </div>
                </form>
            </div>
            <div class="col-md-2 col-sm-1"></div>
        </div>
    </div>
</section>


<!-- footer section -->
<footer class="parallax-section">
    <div class="container">
        <div class="row">
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.6s" style="visibility: hidden; animation-delay: 0.6s; animation-name: none;">
                <h2 class="heading">Contact Info.</h2>
                <div class="ph">
                    <p><i class="fa fa-phone"></i> Phone</p>
                    <h4>090-080-0760</h4>
                </div>
                <div class="address">
                    <p><i class="fa fa-map-marker"></i> Our Location</p>
                    <h4>120 Duis aute irure, California, USA</h4>
                </div>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.6s" style="visibility: hidden; animation-delay: 0.6s; animation-name: none;">
                <h2 class="heading">Open Hours</h2>
                    <p>Sunday <span>10:30 AM - 10:00 PM</span></p>
                    <p>Mon-Fri <span>9:00 AM - 8:00 PM</span></p>
                    <p>Saturday <span>11:30 AM - 10:00 PM</span></p>
            </div>
            <div class="col-md-4 col-sm-4 wow fadeInUp" data-wow-delay="0.6s" style="visibility: hidden; animation-delay: 0.6s; animation-name: none;">
                <h2 class="heading">Follow Us</h2>
                <ul class="social-icon">
                    <li><a href="#" class="fa fa-facebook wow bounceIn" data-wow-delay="0.3s" style="visibility: hidden; animation-delay: 0.3s; animation-name: none;"></a></li>
                    <li><a href="#" class="fa fa-twitter wow bounceIn" data-wow-delay="0.6s" style="visibility: hidden; animation-delay: 0.6s; animation-name: none;"></a></li>
                    <li><a href="#" class="fa fa-behance wow bounceIn" data-wow-delay="0.9s" style="visibility: hidden; animation-delay: 0.9s; animation-name: none;"></a></li>
                    <li><a href="#" class="fa fa-dribbble wow bounceIn" data-wow-delay="0.9s" style="visibility: hidden; animation-delay: 0.9s; animation-name: none;"></a></li>
                    <li><a href="#" class="fa fa-github wow bounceIn" data-wow-delay="0.9s" style="visibility: hidden; animation-delay: 0.9s; animation-name: none;"></a></li>
                </ul>
            </div>
        </div>
    </div>
</footer>


<!-- copyright section -->
<section id="copyright">
    <div class="container">
        <div class="row">
            <div class="col-md-12 col-sm-12">
                <h3>ZENTRO</h3>
                <p>Copyright © Zentro Restaurant and Cafe 
                
                | Design: tooplate</p>
            </div>
        </div>
    </div>
</section>

<!-- JAVASCRIPT JS FILES -->    
<script src="http://guldcat.com/js/jquery.js"></script>
<script src="http://guldcat.com/js/bootstrap.min.js"></script>
<script src="http://guldcat.com/js/jquery.parallax.js"></script>
<script src="http://guldcat.com/js/nivo-lightbox.min.js"></script>
<script src="http://guldcat.com/js/wow.min.js"></script>
<script src="http://guldcat.com/js/custom.js"></script>


</body></html>


Source: stackoverflow