href and offset

houarim
Offline
Last seen: 6 months 1 week ago
Sun, 08/23/2015 - 01:54
#1
href and offset

Hi,

I am having a problem finding how to land an href link in the one-page template. If I click on a menu item, the page scrolls too far from the section I need to reach, the id.

Where can we control the offset please? "offset: 80" for example. Same with the r-scroll-down... Where can we control where it stops scrolling please? I need the scrolling to STOP exactly where I set the id anchor point.

Thank you very much for your help, I am almost done with this project!

Cordially,

cindy
cindy's picture
Offline
Last seen: 2 days 13 hours ago
Mon, 08/24/2015 - 10:01

Hi,

1. In file html, please search to the line: <body class="home" data-spy="scroll"> 

and add the attribute data-offset="80"
For ex:
<body class="home" data-spy="scroll" data-offset="80">

2. Also in file html, search and change the line: scrollTop: $($anchor.attr('href')).offset().top
into:

scrollTop: $($anchor.attr('href')).offset().top - 80

3. Open file scripts.js and change the line: scrollTop: SectionNext.offset().top
into
scrollTop: SectionNext.offset().top - 80

Log in or register to post comments