Skip to content

Instantly share code, notes, and snippets.

@tdantas
Created April 20, 2015 23:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdantas/616ae3ecf7b5e2ffaa4b to your computer and use it in GitHub Desktop.
Save tdantas/616ae3ecf7b5e2ffaa4b to your computer and use it in GitHub Desktop.
var page;
window.onload = function() {
page = document.getElementsByTagName('html');
page.addEventListener('DOMMouseScroll', <HANDLER>, false);
}
window.mimicWheel = function() {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent('DOMMouseScroll', <OPTIONS> )
page.dispatchEvent(evt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment