Created
November 12, 2018 08:13
-
-
Save biojazzard/08e317cb30bd78e08bcd93b93ddc4fff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smoothscroll = require 'smoothscroll-polyfill' | |
smoothscroll.polyfill(); | |
_ss_to_links = ($el)-> | |
$el.each ()-> | |
$(@).on 'click', (e)-> | |
#console.log $(@) | |
e.preventDefault() | |
anchor = $(@).attr('href') | |
ss anchor | |
_ss_to_links $('.bn-scroll-to') | |
ss_to = (toElClassOrId)-> | |
document.querySelector(toElClassOrId).scrollTo | |
top: 0 | |
behavior: 'smooth' | |
ss = (toElClassOrId)-> | |
document.querySelector(toElClassOrId).scrollIntoView | |
behavior: 'smooth' | |
block: 'start' | |
setTimeout -> | |
if drawer.open | |
drawer.open = false | |
, 1111 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment