Skip to content

Instantly share code, notes, and snippets.

View marker1k's full-sized avatar

Mark Polovtsev marker1k

View GitHub Profile
<style>
#adfox_152725011687362923 {
opacity: 0;
max-height: 0;
transition: all 0.5s;
}
#adfox_152725011687362923>div {
float: left;
clear: both;
@marker1k
marker1k / sticky.js
Last active October 31, 2018 10:44 — forked from lucdkny/sticky.js
Sticky Sideabr With Vanilla Javascript. Unstic on end element added // and getBoundingClientRect() is used
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {
window.addEventListener('scroll', this.onScroll.bind(this));
@marker1k
marker1k / sticky.js
Created October 31, 2018 08:43 — forked from javierarques/sticky.js
Sticky Sideabr With Vanilla Javascript. Detects scroll and set fixed the element. Live example: http://codepen.io/javiarques/pen/vKdgjR
// Sticky Nav Component
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {