Ho una configurazione a doppio monitor con diverse risoluzioni dello schermo e quando visito lo this page in Chrome mostra la risoluzione corretta per entrambi gli schermi. Ma IE mostra solo la risoluzione del mio schermo principale. Appare rispetto a IE window.screen.availWidth
e window.screen.availHeight
restituisce solo i valori per la schermata principale. Posso ottenere la risoluzione dello schermo per il secondo schermo che esegue Internet Explorer?Window.screen in Internet Explorer e più di un monitor
risposta
Utilizzando antico codice trovato su http://archive.cpradio.org/code/javascript/dual-monitors-and-windowopen/
function FindLeftWindowBoundry()
{
\t // In Internet Explorer window.screenLeft is the window's left boundry
\t if (window.screenLeft)
\t {
\t \t return window.screenLeft;
\t }
\t
\t // In Firefox window.screenX is the window's left boundry
\t if (window.screenX)
\t \t return window.screenX;
\t \t
\t return 0;
}
window.leftWindowBoundry = FindLeftWindowBoundry;
// Find Left Boundry of the Screen/Monitor
function FindLeftScreenBoundry()
{
\t // Check if the window is off the primary monitor in a positive axis
\t // X,Y X,Y S = Screen, W = Window
\t // 0,0 ---------- 1280,0 ----------
\t // | | | --- |
\t // | | | | W | |
\t // | S | | --- S |
\t // ---------- ----------
\t if (window.leftWindowBoundry() > window.screen.width)
\t {
\t \t return window.leftWindowBoundry() - (window.leftWindowBoundry() - window.screen.width);
\t }
\t
\t // Check if the window is off the primary monitor in a negative axis
\t // X,Y X,Y S = Screen, W = Window
\t // 0,0 ---------- -1280,0 ----------
\t // | | | --- |
\t // | | | | W | |
\t // | S | | --- S |
\t // ---------- ----------
\t // This only works in Firefox at the moment due to a bug in Internet Explorer opening new windows into a negative axis
\t // However, you can move opened windows into a negative axis as a workaround
\t if (window.leftWindowBoundry() < 0 && window.leftWindowBoundry() > (window.screen.width * -1))
\t {
\t \t return (window.screen.width * -1);
\t }
\t
\t // If neither of the above, the monitor is on the primary monitor whose's screen X should be 0
\t return 0;
}
window.leftScreenBoundry = FindLeftScreenBoundry;
console.log(window.screen.width);
console.log(window.leftScreenBoundry());
console.log(window.screen.height);
io so che non è molto, ma sarà almeno permetterà di valutare se il client è su un doppio monitor impostato e la larghezza il set è.
L'unica cosa importata da IE è distribuire la risoluzione in modo uniforme tra tutti i montatori.
Quindi occupa una larghezza totale e lo divide per numero di monitor.
Ho 3 monitor, 2 a 1920 x 1080 e uno a 1600 x 900 per il mio test e IE ha dato la posizione a sinistra come 1745 0 -1745 quindi sì ... qualcosa è spento con IE in tutto, ma hopefull questo un piccolo frammento ti aiuterà, o qualcun altro un po 'più lontano sta facendo un codice semi-compatibile per IE.
Ho già trovato quel codice e non posso usarlo. Il mio schermo sinistro è 1600x900 e il mio schermo destro 1920x1080. Lo schermo di destra è il mio schermo principale. 'window.leftScreenBoundry()' restituisce -1920 e questo è fuori dai limiti del mio desktop. –
stesso qui. ha a che fare con l'ordinamento dei monitor e così via. non c'è molto che tu possa fare al riguardo. Che cosa stai cercando di ottenere? – Tschallacka
ridimensionamento della finestra. Ho alcuni elementi dinamici, che mi impediscono di consentire a IE di gestire le dimensioni della finestra. –
- 1. AngularJS e Internet Explorer
- 2. Caratteri Unicode e Internet Explorer
- 3. Visualizzazione immagini di Internet Explorer e Base64
- 4. Vaadin lento in Internet Explorer
- 5. Internet Explorer 9 VHD
- 6. Avvia Internet Explorer nascosto
- 7. execCommand ("insertHTML", ...) in Internet Explorer
- 8. Plugin NPAPI in Internet Explorer?
- 9. Internet Explorer 6 test
- 10. Internet Explorer toDataURL() alternativa?
- 11. Testo ombreggiato in Internet Explorer?
- 12. espresso tornata di Internet Explorer
- 13. Internet Explorer Jumpy Scrolling
- 14. Etichette e campi nascosti in Internet Explorer (e jquery)
- 15. Internet Explorer 8 e jquery addEventListener
- 16. CodeIgniter 2.x sessioni e Internet Explorer
- 17. setTimeout Internet Explorer
- 18. Stampa di esportazione PDF in Internet Explorer
- 19. Posizione cache di Internet Explorer
- 20. problema jQuery e Internet Explorer (IE9)
- 21. Internet Explorer supporta pushState e replaceState?
- 22. supporto di VBScript in Internet Explorer 11
- 23. XDR su Internet Explorer 11
- 24. Z-index in Internet Explorer non funziona
- 25. Prestazioni di Internet Explorer 11 con JS
- 26. $() funziona in modo diverso in Internet Explorer?
- 27. Altezza: Auto in Internet Explorer 8 e sotto
- 28. posizione: bordo relativo nascosto in Internet Explorer
- 29. Tabella altezza riga in Internet Explorer
- 30. Codici di stato HTTP di errore Internet Internet Explorer
di quale versione stiamo parlando, versione minima supportata ecc. – Tschallacka
IE8 (IE11 in modalità IE8) sarebbe ottimo, ma solo IE11 andrebbe bene. –