Thursday, October 29th, 2009

S2.enableMultitouchSupport = true; // Getting touchy feely with scripty

Category: Prototype, Scriptaculous

<p>

Thomas Fuchs has been working with Nokia on their multi-touch API for Qt/WebKit:

scripty2 supports multiple API vendors for Multitouch events, and even provides a desktop emulation (click+drag to pan, shift+click+drag to scale and rotate)– so you can try this out even without having multitouch hardware at your disposal.

Currently the scripty2 API abstraction event supports Desktop emulation, Nokia Starlight and Apple iPhone Mobile Safari. With just one API, you can now multi-touch enable any web application easily, just check out the demos.

In a recent update to scripty2, I’ve also introduced automatic support for WebKit CSS transitions, so whenever scripty2 effects are used and CSS transitions are available, the effects engine will automatically do the right thing for you.

All in all, using this in your web sites or apps boils down to just a couple of lines of code:

javascript
< view plain text >
  1. $('element').observe('manipulate:update', function(event){
  2.   $('element').transform(event.memo).setStyle({
  3.      left: event.memo.panX+'px', top: event.memo.panY+'px'
  4.   });
  5. });

Related Content:

Posted by Dion Almaer at 6:56 am
4 Comments

++---
2.2 rating from 62 votes

4 Comments »

Comments feed TrackBack URI

I wonder when will IE support this…

:D

Comment by cope — October 29, 2009

@cope – When one of the myriad “render my html in flash” programs gets advanced enough and implements the w3c device api. Or when someone does effectively the same thing by recompiling fennec to actionscript using alchemy. I’ve come to see flash not as an enemy, but as an autoupdating trojan horse for IE.

This scripty2 multitouch stuff is wonderful, _the_ killer app for scripty2 so far. One step closer to breaking down the barrier between mobile webapps and mobile native aka one less reason to risk appstore approval wrath.

Comment by rdza — October 29, 2009

Nice

Comment by MichaelSchoeler — November 2, 2009

many thanks
i do like and spend a lot of time leraning about stuff on this site

Comment by Aphrodisiac — January 22, 2010

Leave a comment

You must be logged in to post a comment.