for some reason on my site and only in Chrome on certain pages
1. https://www.prophix.com/contact/
2. https://www.prophix.com/resource-library/video-library/
There is some sort of “auto scroll” happening, when I scroll down the page and at certain points on both pages when I stop scrolling the page automatically starts scrolling up on its own.
How do I fix this? Please help, any assistance would be greatly appreciated.
Thanks,
]]>How do I fix this?
]]>Attempted to auto-scroll to element with data-scroll-name [], but could not find any elements with that name.
]]>Smooth Scrolling JS
Automatically detects changes to the pages hash and scrolls the user to the corresponding element. Checks on load if there is a hash, and attempts to find it.
Element should be set up with the following attributes:
<div data-scroll-name=’UNIQUENAME’
data-scroll-speed=’Jquery Speed’ optional, defaults to ‘slow’
data-scroll=offset=’-200′ offset in px you’d like the scroll to stop at. Good for accomodating header bars. Defaults to -50.
>
Call the watcher to queue up the doer
*/
//Watcher
function watchForSmoothScrolls(){
jQuery(window).bind(‘hashchange’, function(){
var newHash = location.hash.substring(1);
scrollTo(newHash);
});
var newHash = location.hash.substring(1);
scrollTo(newHash);
}
//Doer
function scrollTo(anchor){
var $elem = jQuery(“[data-scroll-name='”+ anchor +”‘]”);
if($elem.length == 0){
console.warn(‘Attempted to auto-scroll to element with data-scroll-name [‘ + anchor + ‘], but could not find any elements with that name.’);
return false;
}
var scroll_speed = $elem.attr(‘data-scroll-speed’);
if(!scroll_speed){
scroll_speed = ‘slow’;
}
var scroll_offset = parseInt($elem.attr(‘data-scroll-offset’));
if(!scroll_offset){
scroll_offset = -100;
}
jQuery(‘html,body’).animate({scrollTop: ($elem.offset().top + scroll_offset)},scroll_speed);
}
/*
]]>