If you ever went through 9gag(if you haven't, srsly :O), you would have seen how easy it is to navigate on their site by just clicking the right and left navigation key to go forth and back respectively.

I just liked the concept and wished that it was at other places around the web, for example here.(I would highly recommend you to check out this link and see all the other books provided for free by O'reilly publications). If you are reading a book there and see those arrow signs on both sides, you would naturally push the right key to move to next chapter, but unluckily it doesn't work.

So I thought, today I will learn it, the way to take keyboard events. did some search and found out that there is really easy way to do it using jquery. so I wrote some basic code to test it out. and here is the output. Now to simulate the 9gag type functionality, we just need to grab the keycode of the left and right keys and put it down in our app.
here is an example and here is the code. Now when you see the code, y'd say, its so easy. Truth is  things are always easy, it only matters when we dig them or do we dig them.
Happy Diwali

Your comment will be posted after it is approved.


Leave a Reply.