I stumbled on that by accident. One of my javascript-variables was called orientation and was not correctly used on the iPad’s Safari.
After looking at its content, I found out that you can detect the device orientation. I knew you can handle many cool things on the iOS, like swipes in javascript, but this one was new to me.
So, what are you going to do with this? It’s obvious: Style your website or re-order your content to match exactly your iPad’s orientation ;-)
You can use javascript in an event handler, loop, or whatever by accessing window.orientation (or only orientation).
Here’s an example on how to detect the current orientation of the iPad device either by pressing a button or when the orientation changes, using an event called onOrientationChange:
You can also use CSS Stylesheets using the media definition:
The detection is not restricted to the iPad, it should work on all iOS devices.
Since I have just added the first image in a previous post and I wanted to make it look good, I installed two WordPress PlugIns that will improve my Blog and are also available for everyone’s website:
1) Lightbox
Everyone seems to know Lightbox now, it creates these nice image layers on top of the website.
This was new to me and I love it. Have you seen these reflection effects on some websites? Especially Apple was using them in iWeb. The most reflections until now were made in Photoshop and uploaded as image.
But now there is a small javascript library “Reflection” that does the job.