jeudi 30 juin 2016

hiding browser navigation status bar for google chrome using javascript


I'm trying to to disable google chrome browser navigation status bar on the bottom left for a full screen web app that will be used on touch screen panel. I have a working code for jQuery but I can't use that since my code based on pure JavaScript. Only workaround find is to remove all href tags on mouse hover, keep the data temporarily on a data tag and once it's click navigate to link as how it is suppose to be using the data tag. here is how it looks like without disabling it once its hover. I was able to remove the href with JavaScript but couldn't add the links afterwards. var linksAhref = document.getElementsByTagName('a'); var linksData = document.getElementsByTagName('[href]'); var replaceFunc = function() { for (var i = 0; i < linksAhref.length; i++) { var href = linksAhref || linksData; // console.log(href); linksAhref[i].removeAttribute("href"); // window.location.href = href; } }; for (var i = 0; i < linksAhref.length; i++) { linksAhref[i].addEventListener('mouseover', replaceFunc); } <ul> <li><a href="link-1">Link 1</a></li> <li><a href="link-2">Link 3</a></li> <li><a href="link-3">Link 4</a></li> <li><a href="link-4">Link 5</a></li> </ul> Here is the code that works in jQuery: jsfiddle:

Aucun commentaire:

Enregistrer un commentaire