I am currently working on implementing iOS web app properties into my website. My goal is to create a <div>
at the top of the page and apply specific CSS styles when a certain condition is met in a JavaScript script.
Unfortunately, I am facing issues with getting the styles to work properly. You can see a demonstration of my concept here: jsFiddle
The JavaScript code I am using on my actual website () is as follows:
<script type="text/javascript">
function statusBarBG(){
if (("standalone" in window.navigator) && window.navigator.standalone) {
$('.status-bar').css('width', '100%');
$('.status-bar').css('height', '20px');
$('.status-bar').css('position', 'fixed');
$('.status-bar').css('background', '#454545');
$('.status-bar').css('z-index', '9999');
};
};
</script>