Update:
Sorry about the confusion.
What I'm trying to do is making a web page scroll down to its very end, every 5 seconds, how can I do that?
I tried repeat pressing the end
key to get this happen, but I fails.
These were my attempts:
function pressEnd() {
$('body').keypress({keyCode: 35});
}
setInterval(function () {
pressEnd();
}, 5000);
And:
$('body').trigger('keydown', {which: 35});
And:
var event = $.Event('keydown', {keyCode: 35});
$('body').trigger(event);
Also tried to change the selector from body
to document
and window
!
What am I missing?