I am trying to Simulate a scroll event using Javascript for Mobile Safari. I am using the following code
var evt = document.createEvent("MouseEvents"
The event that worked for me was mousewheel
, and the 5th parameter needs to be positive for scrolldown and negative for scrollup.
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("mousewheel", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
Note that the event type is DOMMouseScroll
for FireFox.