sm-scroll-to-element

scroll to element

Usage no npm install needed!

<script type="module">
  import smScrollToElement from 'https://cdn.skypack.dev/sm-scroll-to-element';
</script>

README

Installation

npm install sm-fetcher --save

Install

es5

const ScrollTo = require('sm-scroll-to-element');

es6 - es7

import ScrollTo from 'sm-scroll-to-element';

Usage

<Button onClick={() => ScrollTo('.screen-4-title', 0)} className='white-btn'>Leave a Request</Button>

Arguments

1 - selector. String or document element;
2 - offset (pixels), default = 100;