CSS trick mimics sideways-flicking behavior in MobileSafari
Ajaxian has posted a ridiculously simple way to enable web apps to mimic the iPhone's side-to-side flicking behavior using custom CSS supported by MobileSafari. If you're creating a web app specifically for iPhone and iPod touch users, you can get a similar feel to a native application with MobileSafari.
MobileSafari includes some CSS 3 support, including advanced DOM selectors and support for animations and transitions. Chances are, other browsers will have limited support for CSS 3 draft standards, and whatever you write probably will only work in MobileSafari and Safari 3 on the desktop.
The test application in this movie shows how it tracks finger movements across the screen, and performs actions based on the distance "swiped." Very nifty.
[Via Cameron.io.]
Share
Categories
Ajaxian has posted a ridiculously simple way to enable web apps to mimic the iPhone's side-to-side flicking behavior using custom CSS...
Add a Comment
Brandon - This is an upgrade to the iPhone's Mobile Safari that enables the WebKit CSS3 transitions and adds touch events to JS. Essentially it's an upgrade to all three. This is not currently supported by 'normal' Safari, as far as I know, but I don't think it would take a lot to implement. I also don't think that it's evidence enough for any rumors about touch-enabled laptops or tablets; the CSS transitions are coming out of WebKit (and have been for a long while), while the touch events are, well, because it's an iPhone ;)
August 14 2008 at 6:38 PM Report abuse Permalink rate up rate down ReplyThis is bad-ass Robert, thanks for the post.
August 14 2008 at 12:10 PM Report abuse Permalink rate up rate down ReplyI know the mobile version of Digg (http://m.digg.com) has had animated transitions since they launched the site for the original iPhone almost a year ago, but I don't think I've seen any sites that made use of gestures like swiping. Is that part of the iPhone, CSS, or Safari 3; I'm a little unclear on that from the article? If it is a new part of Safari, that may be evidence of it being a built-in feature for new multi-touch enabled laptops or - gasp - an Apple Tablet PC!
August 14 2008 at 5:04 AM Report abuse Permalink rate up rate down ReplyPretty cool. Nice work!
August 14 2008 at 2:26 AM Report abuse Permalink rate up rate down ReplyNice. A good addition would be the soft rebound you get when you reach the last item on the page, like if you try to scroll off the edge of a regular safari page.
Well done!
Yes, this will only work for iPhones with firmware 2.0 or above. The CSS3 transitions, as well as the new Touch events, are both part of that upgrade.
I've been messing around with this script over the past week and have run into some issues that Apple didn't take care of very well; will be posting an update to the article tomorrow.
Thanks TUAW for posting this =]
I'm not positive, but I think this will only work with the 2.0 update.
August 13 2008 at 11:45 PM Report abuse Permalink rate up rate down ReplyThat looks pretty slick. I'll have to try it out.
August 13 2008 at 10:23 PM Report abuse Permalink rate up rate down ReplyHot Apps on TUAW
Deals of the Day
more deals- Verizon Leather Sleeve for Tablets for $4 + free shipping
- Wicked Jaw Breaker Noise-Isolating In-Ear Headphones for $6 + free shipping
- Refurb Apple MacBook Air Laptops: 12" 64GB SSD for $699 + free shipping
- JVC Motion Sensing Clock Radio with Dual iPod Docks for $55 + free shipping
- Apple iPhone Headset with Mic for $4 + $2 s&h
- Refurb Apple iPod nano 8GB MP3 Player for $99 + free shipping, 16GB for $119
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



8 Comments