I've tried several suggestions from this forum and none have worked for me:
I'm trying to use a script which can identify the Android stock browser so I can increase the font size on a selected area of text.
I've tried the following scripts
var nua = navigator.userAgent;
var is_android = ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1));
And
var nua = navigator.userAgent;
var is_android = ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1));
From here: Javascript detect android native browser
And
function isAndroidBrowser() {
var objAgent = navigator.userAgent;
var objfullVersion = ''+parseFloat(navigator.appVersion);
if ((objOffsetVersion=objAgent.indexOf("Chrome")) != -1) {
objfullVersion = objAgent.substring(objOffsetVersion+7, objOffsetVersion+9);
if (objfullVersion < 19) {
return true;
}
}
return false;
}
From here: http://danecando.com/detecting-androids-native-browser-javascript/
And I've tried Modernizer using the suggestion here: http://codepen.io/anon/pen/KwLmeZ (I used the full developer code js with "addTest")
Nothing has worked.
I've tried using the codepen idea's method for changing a CSS class as well as either of these 2 formats without success: $("paratext").css("fontSize", "150%"); $('.paratext').css("font-size", "150%");
Can anyone show me the full coding needed to a) identify the stock browser and b) to change the class "paratext" font size?
I need to be spoonfed the full code because I think that's where I'm falling.
I tried starting the scripts with $(document).ready(function() {
Or $(function() {
And still didn't get any if the ideas above to work.
Any help would be greatly appreciated!
What I've tried to use last was the idea displayed at codepen above:
In the section I called up modernizr.js (development version) and the callup.
I've got this: Modernizr.addTest('androidStock', function () { var nua = navigator.userAgent; var is_android = ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1)); return is_android; });
And this is my edit if codepen's CSS: .androidstock{ .paratext{ font-size: 150%; } /* .negative{ display: none; }*/ }