EvoToolkit - v3.6.0 (Changelog)

Click Scroll

An implementation of the scrollTo tool allowing you to trigger scroll functionality on click using the data-scroll and data-scroll-offset attributes.

Note: By accessing the evotoolkit object in the global scope, you can refire this module on demand in case you programatically add DOM nodes after initial page load.


					evotoolkit.utility.clickScroll()
				

Source

Contributors

Luke Harrison

Base

<img class="u-mb-regular u-width-full js-cat" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 250 167' /%3E" data-lazy-src="/static/img/cat3-a11790409f.jpg" loading="lazy">
<p class="u-align-center" style="height:1000px;"></p>

<button class="c-button u-mb-small" data-scroll="js-cat" data-scroll-offset="-30">Scroll to cat</button>
<button class="c-button u-mb-small" data-scroll="top">Back to top</button>