im having some Problems with my html/javascript project, while chrome seems fine with my code both firefox and ie deny to work how i want them to. Following you see the code which is causing trouble...
<script>
if (window.DeviceOrientationEvent) {
console.log("DeviceOrientation is supported");
window.addEventListener("deviceorientation", handleOrientation);
} else {
console.log("DeviceOrientation is not supported");
}
</script>
with
var handleOrientation = function(event){
if(event.alpha!=null || event.beta!=null || event.gamma!=null) {
var alpha = Math.round(event.alpha);
var beta = Math.round(event.beta);
var gamma = Math.round(event.gamma);
if (WURFL.form_factor == "Tablet") {
tabletOutput();
}
orientationFunction(alpha, beta, gamma);
if(navigator.userAgent.match(/Android/i)){
document.getElementById("androidSpecial").style.display = "inline";
}
} else {
desktopOutput();
}
};
tabletOutput as well as desktopOutput only change the display values of some classes in my css document.
As i said chrome gets to the desktopOutput function but firefox and ie just log "DeviceOrientation is supported" then ignore the window.addEventListerner and keep going.
Thanks for any help!