Closed afmklk closed 9 years ago
Added optional context argument to scroll element instead of window.
For example, let's say you have a fixed height container with a larger element inside:
<div id="container" style="height: 100px; overflow-y: scroll;"> <div id="element" style="height: 1000px;"></div> </div>
You can now call:
var el = document.querySelector('#element').scrollHeight; var duration = 1000; var callback = null; var context = document.querySelector('#element'); smoothScroll(el, duration, callback, context);
to scroll to bottom of container.
Added optional context argument to scroll element instead of window.
For example, let's say you have a fixed height container with a larger element inside:
You can now call:
to scroll to bottom of container.