Signature pad is slow on android
I am using Thomas J Bradley plugin for drawing signature on touch devices like ipad/xoom/galaxy... I have a simple jsp page which includes jquery and signature pad scripts开发者_如何学Python
$('div.signaturePadClass').signaturePad({displayOnly:false})
works like a charm on ipad, but it is kind a slow on android (xoom/samsung galaxy). I checked the plugin homepage on these devices, and the demo on the home page is also slow on android.
Is there a workaround?.. fix for this? Or is there a better plugin out there?. If no, then whats the reason for this slowness... is it just a slow android?
Environment
Unfortunately, you cannot influence the way android (the used web browser, did you test it on different ones?) executes javascript. You could use a 3rd party javascript engine but X8 (which uses google chrome) is said to be one of the best, already.
Hardware
If you are using Android 3.0 or above you can enable hardware acceleration.
Add android:hardwareAccelerated="true"
to your manifest application
tag to enable it.
Hopefully it may work.
Optimize the code
A large amount of optimizations should be concerned when writing javascript for mobile devices. The two most important are:
- Do as much as possible serverside (To execute only the javascript which really is neccessary)
- Avoid manipulating the DOM (which makes javascript that slow)
- For more performance hints look here and here
精彩评论