Scroll To Specfic Content Or Point Within The Document – GoScrollJs

Category: Animation , Javascript | July 8, 2018
Author:BaseMax
Views Total:138 views
Official Page:Go to website
Last Update:July 8, 2018
License:MIT

Preview:

Scroll To Specfic Content Or Point Within The Document – GoScrollJs

Description:

GoScrollJs is a lightweight, performant, vertical smooth scroll JavaScript library that enables trigger element to smoothly scroll the page to a specific element or point within the document.

How to use it:

Import the GoScrollJs’ JavaScript into the document and we’re ready to go.

<script src="GoScroll.js"></script>

Scroll to a target element using the data-scroll-go attribute.

<button data-scroll-go="header">
  Back To Top
</button>

Scroll to a specific point using the data-scroll-to attribute. This value can be positive or negative.

<button data-scroll-to="100">
  GOTO 100px
</button>

Scroll to a specific position with an offset. This value can be positive or negative.

<button data-scroll-offset="-800" data-scroll-go="header">
  Go Header with custom offset
  <br>
  (header position - (-800) = (header position + 800)
</button>

You Might Be Interested In:


Leave a Reply