Smooth Scroll JS - Accessible

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function() {

//This function has been updated to maintain tab focus for accessibility

//reference https://codepen.io/theandyyates/details/dGovD

$('a[href*=#]:not([href=#])').click(function(event) {

if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {

target = $(this.hash);

target = target.length ? target : $('[name=' + this.hash.slice(1) +']');

if (target.length) {

$('html,body').animate({

scrollTop: target.offset().top

}, 875, function(){

target.attr('tabindex', '-1');

target.focus();

});

location.hash = target;

return false;

}

}

});

});

 

 

 

//IMAGE CYCLING
jQuery(document).ready(function(){
jQuery('.os-slider1') .cycle({
fx: 'fade', // here change effect to blindX, blindY, blindZ etc 
speed: 'slow', 
timeout: 2000 
});
}); 
</script>

See also: Effects