Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Lets take a walkthrough of the meaningful parts of the preceding code.

Firstly, w e make a determination as to whether the version of WebKit that the Android device we a re using supports the orientationchange event: var canDetect = "onorientationchange" in window; Then we use the jQuery bind method to attach ourselves to the relevant eventbased on the previous detection. Here I use the ternary (or elvis) operator to save so me keystrokes. (I apologize if you arent a fan of Elvis, but I am, so expect to see more of him.)

You might also like