Skip to content

Instantly share code, notes, and snippets.

@neovea
neovea / StickyDomScroll.js
Created October 6, 2017 09:12
Make DOM element sticky on scroll
/**
* STICKY FILTERS
*/
class StickyDomScroll {
constructor () {
this.selector = null
this.initialPosition = null
this.parentDiv = null
this.newElement = document.createElement('div')
this.initialPosition = null
@neovea
neovea / SwitchButton.js
Created October 6, 2017 09:13
Switch button
class SwitchButton {
constructor () {
this.switchButton = null
}
init (button) {
this.switchButton = button
this.switchInput = this.switchButton.getElementsByTagName('input')
this.blockBasic = document.querySelectorAll('.basic-display')