English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
widthProprietà di sola lettura che restituisce la larghezza totale dello schermo (in pixel).
UsoheightProprietà che ottiene l'altezza totale dello schermo (in pixel).
screen.width
var x = "Total Width: "+ screen.width;Prova a vedere‹/›
Tutti i browser supportano completamente la proprietà width:
Proprietà | |||||
width | Sì | Sì | Sì | Sì | Sì |
Valore di ritorno: | Un numero che rappresenta la larghezza totale dello schermo dell'utente in pixel |
---|
Questo esempio mostra tutte le proprietà dello schermo:
var txt = ""; txt += "<p>Total width/height: "+ screen.width + "*" + screen.height + "</p>"; txt += "<p>Larghezza/Altezza disponibile: " + screen.availWidth + "*" + screen.availHeight +"</p>"; txt += "<p>Profondità del colore: " + screen.colorDepth + "</p>"; txt += "<p>Resoluzione del colore: " + screen.pixelDepth + "</p>"; document.write(txt);Prova a vedere‹/›
Riferimento screen:Proprietà screen.availHeight
Riferimento screen:Proprietà screen.availWidth
Riferimento screen:Proprietà screen.colorDepth
Riferimento screen:Proprietà screen.height
Riferimento screen:Proprietà screen.pixelDepth