Skip to content

Instantly share code, notes, and snippets.

View hohoya33's full-sized avatar

HO 'ㅡ') hohoya33

View GitHub Profile
@hohoya33
hohoya33 / gist:93c2612cd04002916118260d8828430c
Created October 30, 2016 16:15 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa