Skip to content

Instantly share code, notes, and snippets.

@biojazzard
Created November 12, 2018 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biojazzard/08e317cb30bd78e08bcd93b93ddc4fff to your computer and use it in GitHub Desktop.
Save biojazzard/08e317cb30bd78e08bcd93b93ddc4fff to your computer and use it in GitHub Desktop.
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