mirror of
https://github.com/JamesonHuang/OpenWrt_Luci_Lua.git
synced 2024-11-24 14:20:10 +00:00
30 lines
889 B
HTML
30 lines
889 B
HTML
|
<script>
|
||
|
var isMobile = {
|
||
|
Android: function() {
|
||
|
return navigator.userAgent.match(/Android/i);
|
||
|
},
|
||
|
BlackBerry: function() {
|
||
|
return navigator.userAgent.match(/BlackBerry/i);
|
||
|
},
|
||
|
iOS: function() {
|
||
|
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
|
||
|
},
|
||
|
Opera: function() {
|
||
|
return navigator.userAgent.match(/Opera Mini/i);
|
||
|
},
|
||
|
Windows: function() {
|
||
|
return navigator.userAgent.match(/IEMobile/i);
|
||
|
},
|
||
|
any: function() {
|
||
|
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
|
||
|
}
|
||
|
};
|
||
|
//Hide the Address Bar within Mobile Web Applications
|
||
|
window.addEventListener&&window.addEventListener("load",function() {
|
||
|
// Set a timeout...
|
||
|
setTimeout(function(){
|
||
|
// Hide the address bar!
|
||
|
window.scrollTo(0, 1);
|
||
|
}, 0);
|
||
|
});
|
||
|
</script>
|