Change Scroll to (anchor) function starting point

Hi guys, i have a sticky header that is interfering with PRO’s own scroll to function.

How can i fix it? here’s a small video of the issue: https://www.useloom.com/share/b71facf7b8524ef3bdb1f37ed80bfa04

see how the sections basically starts behind the header? how can i make it so that it starts after the header?

Thanks in advance!

Hello There,

Thanks for posting in! The one page navigation or scroll to section/anchor is not fully supported yet with Pro theme. To resolve your issue, please add this JS code in the Theme Options > Global JS (http://prntscr.com/evswzb)

jQuery ( document ).ready( function($) {

setTimeout ( function() {

//$('a[href*="#"]').off();

$(document).on('click', 'z[href*="#"]', function(e) {

e.preventDefault();

console.log( $(this).attr('href') );

var hash = '#' + $(this).attr('href').split('#')[1];

if ( hash == '#' ) return false;

$('html, body').stop().animate({ scrollTop : $(hash).offset().top - $('.x-bar-fixed').height() });

} );

}, 500 );

} );

Hope this helps. Please let us know how it goes.

Tried this code but it didn’t seem to work :frowning: can you take a look at the code on the site and see if i missed something?

Hey There,

Sorry if the code did not work. There was a typographic error. Please use this instead:

jQuery ( document ).ready( function($) {

setTimeout ( function() {

//$('a[href*="#"]').off();

$(document).on('click', 'a[href*="#"]', function(e) {

e.preventDefault();

console.log( $(this).attr('href') );

var hash = '#' + $(this).attr('href').split('#')[1];

if ( hash == '#' ) return false;

$('html, body').stop().animate({ scrollTop : $(hash).offset().top - $('.x-bar-fixed').height() });

} );
Please let us know how it goes.}, 500 );

} );

Please let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.