Do a barrel roll with your website!

Recently I became away of a cool easter egg on the google search page. You can see it by going to https://www.google.com/search?q=do+a+barrel+roll. If you are too busy to click on that link, I'll explain it for you. Basically, when you search for do a barrel roll, the page will rotate. I implemented this cool effect into this blog for webkit and mozilla users; simply type "do a barrel roll" into the search box and hit enter(or click search) and the site will rotate. Below is how you can implement it on your own site using native javascript, and how you can enhance it with jQuery to get a smoother effect or add easing.

Getting values from the query string using JavaScript

Getting values from the query string using JavaScript is not very straight forward. It is very easy for server-side code, however, JavaScript doesn't have any built-in methods to access these values easily. We can however access the query string as a string using the search attribute of the location object.