I've recently started using GoNative, a service that helps me create iOS and Android apps from my website located at
GoNative apps come with user agent detection capabilities, which I've explored in this article:
To hide specific page elements only when visitors are using the apps instead of their mobile browsers, I'm employing the following jQuery code:
<script type="text/javascript">
jQuery(document).ready(function ($){
if (navigator.userAgent.match(/gonative/i)) {
$('#QuickSearchPlaceholder').hide();
$('.xbOffCanvasControls').hide();
};
});
</script>
While this process works seamlessly on the iOS app, I've encountered an issue with the Android app. The elements briefly show before being hidden. Is there a way to preload the code to make them disappear faster without showing momentarily?
Any assistance or advice would be greatly appreciated.