1

My website is only one page, and I would like it to scroll down to the two/three sections I have instead of jumping to the anchor. Any help would be great.

HTML:

<nav id="header-navigation" class="sixteen columns" role="navigation">

<ul id="navigation">
<li><a href="#header-global" title="Home">Home</a></li>
<li><a href="#latest-work" title="Our Work">Startups</a></li>
<li><a href="#contact" title="Contact Us">Contact Us</a></li>
</ul>

</nav><!-- end #header-navigation -->

So do I just add a .js file somewhere? Do I add the following code in my HTML?

<script type="text/javascript">
function scrollTo(target) {
    var targetPosition = $(target).offset().top;
    $('html,body').animate({
        scrollTop: targetPosition
    }, 'slow');
}
</script>

My site is pinstart.us

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Mike H
  • 13
  • 2

0 Answers0