I'm trying to make a canvas where the 开发者_运维技巧client can sign his name. It works well in Chrome v6:
but on Android 1.5 instead of drawing the browser scrolls the page and draws nothing:
I borrows the code from Opera's website. Can I disable the scrolling or how can I make this work?
Thank you!
EDIT
using the events touchstart
, touchmove
and touchend
:
on a LG GW620R using a stylus:
on a Motorola Milestone:
on a Samsung Galaxy:
EDIT 2 works better whitout using the finger nail
@Sirber There might be touchstart and touchend events just like in mobile Safari, have a look at that avenue too. And maybe if you adjust the viewport meta tag there won't be any scrolling, still won't draw but at least it won't scroll.
Good luck,
Mathieu
You're comparing the bleeding-edge in-development Chrome version to a stable 1.5 year old release of a parallel Webkit-based browser... of course there's better support for new HTML5 features in the much-newer experimental browser :) How does it render in a recent Android release (say, 2.2)? How about iOS?
There are definitely nontrivial differences between HTML5 browser support among Android releases (not to mention non-standard browser releases by HTC in SenseUI and the like). Check out the WebKit comparison chart at Quirksmode.
As far as viewport settings and disabling scrolling, Android's Webkit listens to most of the same settings that iPhone Safari does, and Apple has pretty good documentation on the settings you can use to tweak that.
You also may find this quirksmode post about supported events in mobile Safari helpful.
Canvas with iOS is really better (performances). Android browsers are far behind (doesn't work with opera-mini).
If you want to see the difference, just try with http://webdemo.visionobjects.com/ . I'm just doing a quadratic smoothing for an handwriting input method with the HTML5 canvas-element.
tested with iPad1 & Motorola Xoom
精彩评论