Detect Device Orientation
function cekOrientation() {
if (window.matchMedia("(orientation: portrait)").matches) {
console.log("portrait");
} else {
console.log("landscape");
}
}
Written on February 6, 2017
Who are you? I am no one.
function cekOrientation() {
if (window.matchMedia("(orientation: portrait)").matches) {
console.log("portrait");
} else {
console.log("landscape");
}
}