Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JAVASCIPT
- // Manager hotkey
- var i = -1;
- $(document).keydown(function(e) {
- if (e.which == 38) {
- e.preventDefault();
- var len = $('a[id="video-title"]').length;
- console.log(len);
- if (i > 0) {
- i--;
- }
- console.log(i + " " + len);
- $('a[id="video-title"]')[i].focus();
- }
- if (e.which == 40) {
- e.preventDefault();
- var len = $('a[id="video-title"]').length;
- console.log(len);
- if (i < len) {
- i++;
- }
- console.log(i + " " + len);
- $('a[id="video-title"]')[i].focus();
- }
- // Media-play/pause key
- if (e.which == 179)
- $('.ytp-play-button').click();
- });
- /**** CSS ****/
- #video-title:focus {
- border: 1px solid red;
- color: red!important;
- outline-color: yellow;
- }
- #video-title:focus:before {
- content: '► ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement