jquery - How to change transition effect based on android version? -
According to jquerymobile the flip effect is only supported in the last version of Android, how can I create the following button:
Use the 'flip' effect only in Android 2.3.4+ and use the 'fade' effect on earlier versions? If I help, then I am using PhoneGap in my project. Thank you! Step A phonegap must obtain the device's version of API (). Step two is to parse it into an integer or a float number and decide whether to change the domain: You can run it after the - & gt; Note: You can also get Android OS version number in a webpad by checking the & lt; A href = "# ngame" data-roll = "button" data-transition = "flip" data-rel = "dialog" & gt; New game & lt; / A & gt;
var android_version = ParseFloat (device.version); If (android_version & lt; 2.3) {$ .each ($ ['[data-transition = "flip"]), function (index, value) {$ (value) .attr (' data-transition ',' fade ');}); }
deviceready event fire, because
device.version will not be ready until then. In addition, the flip effect will work on the older versions of Android OS, it only looks like a clunkey as it rotates the page as if it is doing a carthale instead of a three-dimensional flip.
navigator.userAgent string. I found regex below another StackWorflow question:
[; (\ S) Android (\ d + (?: \. \ D +) +) [;)] The match against the
Navigator.User Agent string gives me the following output: < / P>
Android 2.3.3; 2.3.3
Comments
Post a Comment