Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programically activate gmails older and newer email buttons

enter image description here

These two buttons are from gmail. They let you go left and right through more emails.

How do I click these buttons using javascript and jquery? I'm willing to use extra libraries if necessary. I'm trying to make a shortcut that lets me use keyboard buttons to click and go to older or newer emails.

like image 701
Charles Haro Avatar asked Nov 24 '25 18:11

Charles Haro


1 Answers

let me know if it helps:-

$(document).keydown(function(e) {
    switch(e.which) {
        case 37: // left
        break;    

        case 39: // right
        break;    

        default: return; // exit this handler for other keys
    }
    e.preventDefault(); // prevent the default action (scroll / move caret)
});
like image 133
Sharique Ansari Avatar answered Nov 27 '25 06:11

Sharique Ansari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!