Return to Snippet

Revision: 37858
at December 18, 2010 14:53 by FatFolderDesigner

Initial Code
function keycatch(){
	var keypress = event.keyCode
	var h1tags = document.body.getElementsByTagName("h1");
		case 37: // Left
				currentpos = currentpos-1;
			return false
		case 39: // Right
				currentpos = currentpos+1;
			return false

Initial URL

Initial Description
Starting with GoogleTV in mind I made a script to help navigate a page key basic key inputs, in this case I'm using the left and right arrows to jump between the H1 tags on a page, although the modifications to make it do other things would be very simple. Theres a more working concept on the link so you can see it in action without any coding on your part (and participate in some proper reading).

There is one downside to this method, if manually scrolling down past an H1 tag it does not realize it, but I'll work on that once I get a chance

Initial Title
Javascript Keyboard Navigation

Initial Tags
javascript, navigation

Initial Language