Tutto ciò che non è iPhone o Tablet allora è iPhone X o superiore quindi poi lo tratto così:
codice:else { ////////////////////////////////////////////////////////////////////////////iPhone X////////////////////////////////// var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; // Get the device pixel ratio var ratio = window.devicePixelRatio || 1; // Define the users device screen dimensions var screen = { width: window.screen.width * ratio, height: window.screen.height * ratio }; if (iOS && screen.width == 1125 && screen.height === 2436) { var cssId = 'iPhone'; // you could encode the css path itself to generate id.. if (!document.getElementById(cssId)) { var link1 = document.createElement('link'); var head = document.getElementsByTagName('head')[0]; link1.id = cssId; link1.rel = 'stylesheet'; link1.type = 'text/css'; link1.href = 'assets/js/dynamicLayout/css/iPhone.css'; link1.media = 'all'; head.appendChild(link1); } var scale = window.devicePixelRatio; var exit = document.createElement("button"); exit.id = "esc"; var search = document.createElement("button"); search.id = "cerca"; $("#idTblContainer .dataTables_scrollBody").css("max-height", "730px"); } }

Rispondi quotando
