Sha256: b2a7b37c1e420d516ddffec6e2be1bb6f7d6c17720f99beb57e2a5de02e513b6
Contents?: true
Size: 535 Bytes
Versions: 5
Compression:
Stored size: 535 Bytes
Contents
const SCROLLING_TOPBUTTON_OFFSET = 300; class TopScroll { constructor() { if (!$('.o-top-scroll-button').length) return; this.topButton = $('.o-top-scroll-button'); this.topButton.click(() => { $('html, body').animate({ scrollTop: 0 }, 700); return false; }); } handleUpdate(e) { if (!this.topButton || e != EVENTS.SCROLL) return; if ($(document).scrollTop() > SCROLLING_TOPBUTTON_OFFSET) { this.topButton.fadeIn('slow'); } else { this.topButton.fadeOut('slow'); } } }
Version data entries
5 entries across 5 versions & 1 rubygems