jkr137 jkr137 - 22 days ago 7
Javascript Question

Auto arrow (right) key press event?

Is it possible to create an auto key press event? I want to flip a book once automatically after refreshing the site?

Thanks in advance!

Answer

This will do it:

$(document).ready(function() {
    var e = $.Event('keydown', { keyCode: 39 });// right arrow key
    $(document).trigger(e);
});

References: