The snap
extension ensures that the Sidescroller’s child elements are always aligned flush with the Overthrow container.
overthrow.sidescroller( document.querySelectorAll( ".overthrow-enabled .sidescroll-nextprev" ), { snapScroll: true });
Will add a disabled
class to nav items upon reaching the start/end of a Sidescroller region.
overthrow.sidescroller( document.querySelectorAll( ".overthrow-enabled .disable-nav" ), { disabledNav: true });
The skiplink
extension adds controls that allow the user to skip to the start/end of Sidescroller.
overthrow.sidescroller( document.querySelectorAll( ".overthrow-enabled .skiplinks" ), { skipLinks: true });
The rewind
extension will allow the Sidescroller to animate back to the first child element upon navigating beyond the last element.
overthrow.sidescroller( document.querySelectorAll( ".overthrow-enabled .rewind" ), { rewind: true });
The goto
extension provides a method for programmatically scrolling to individual child elements.
overthrow.sidescroller( document.querySelectorAll( ".overthrow-enabled .goto-nav" ), { snapScroll: true });
document.querySelector( "a.goto" ).onclick = function( e ){
overthrow.sidescroller( document.querySelectorAll( ".overthrow-enabled .goto-nav" ), "goTo", 3 );
e.preventDefault();
}
Skip to the third slide
The `append` extension provides a method for gracefully handling the addition and removal of child elements.