ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻩﺮﺠﻨﭘ ﻪﺤﻔﺻ


فهرست مطالب

    نمایش فهرست مطالب


ﺖﺳﺍ ﺕﺎﻋﻼﻃﺍ ﯼﻭﺎﺣ window.screen ﯽﺷ


ﻩﺮﺠﻨﭘ ﻪﺤﻔﺻ

.ﺖﺷﻮﻧ ﻩﺮﺠﻨﭘ ﺪﻧﻮﺸﯿﭘ ﻥﻭﺪﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ window.screen ﯽﺷ

:ﺹﺍﻮﺧ

  • screen.width

  • screen.height

  • screen.availWidth

  • screen.availHeight

  • screen.colorDepth

  • screen.pixelDepth


ﻩﺮﺠﻨﭘ ﻪﺤﻔﺻ ﺽﺮﻋ

ﺭﺩ ﺍﺭ ﻩﺪﻨﻨﮐﺪﯾﺩﺯﺎﺑ ﻪﺤﻔﺻ ﺽﺮﻋ screen.width ﯽﮔﮋﯾﻭ

ﻝﺎﺜﻣ

:ﻞﺴﮑﯿﭘ ﻪﺑ ﻪﺤﻔﺻ ﺽﺮﻋ ﺶﯾﺎﻤﻧ

document.getElementById("demo").innerHTML =
"Screen Width: " + screen.width;

:ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻪﺠﯿﺘﻧ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Screen width is " + screen.width;
</script>

</body>
</html>

ﻩﺮﺠﻨﭘ ﻪﺤﻔﺻ ﻉﺎﻔﺗﺭﺍ

.ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﻞﺴﮑﯿﭘ ﺐﺴﺣ ﺮﺑ ﺍﺭ ﻩﺪﻨﻨﮐﺪﯾﺩﺯﺎﺑ ﻪﺤﻔﺻ ﻉﺎﻔﺗﺭﺍ screen

ﻝﺎﺜﻣ

:ﻞﺴﮑﯿﭘ ﻪﺑ ﻪﺤﻔﺻ ﻉﺎﻔﺗﺭﺍ ﺶﯾﺎﻤﻧ

document.getElementById("demo").innerHTML =
"Screen Height: " + screen.height;

:ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻪﺠﯿﺘﻧ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Screen height is " + screen.height;
</script>

</body>
</html>


ﺱﺮﺘﺳﺩ ﺭﺩ ﻩﺮﺠﻨﭘ ﻪﺤﻔﺻ ﺽﺮﻋ

ﺭﺩ ﺍﺭ ﻩﺪﻨﻨﮐ ﺪﯾﺩﺯﺎﺑ ﻪﺤﻔﺻ ﺽﺮﻋ screen.availWidth ﯽﮔﮋﯾﻭ

ﻝﺎﺜﻣ

:ﻞﺴﮑﯿﭘ ﺐﺴﺣ ﺮﺑ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﺩﻮﺟﻮﻣ ﺽﺮﻋ ﺶﯾﺎﻤﻧ

document.getElementById("demo").innerHTML =
"Available Screen Width: " + screen.availWidth;

:ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻪﺠﯿﺘﻧ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Available screen width is " + screen.availWidth;
</script>

</body>
</html>

ﻩﺮﺠﻨﭘ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﺱﺮﺘﺳﺩ ﺭﺩ ﻉﺎﻔﺗﺭﺍ

،ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺍﺭ ﻩﺪﻨﻨﮐﺪﯾﺩﺯﺎﺑ ﻪﺤﻔﺻ ﻉﺎﻔﺗﺭﺍ screen.availHei

ﻝﺎﺜﻣ

:ﺪﯿﻫﺩ ﺶﯾﺎﻤﻧ ﻞﺴﮑﯿﭘ ﺐﺴﺣ ﺮﺑ ﺍﺭ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﺩﻮﺟﻮﻣ ﻉﺎﻔﺗﺭﺍ

document.getElementById("demo").innerHTML =
"Available Screen Height: " + screen.availHeight;

:ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻪﺠﯿﺘﻧ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Available screen height is " + screen.availHeight;
</script>

</body>
</html>

ﻩﺮﺠﻨﭘ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﮓﻧﺭ ﻖﻤﻋ

.ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﮓﻧﺭ ﮏﯾ ﺶﯾﺎﻤﻧ ﯼﺍﺮﺑ ﻩﺪﺷ ﻩﺩﺎﻔﺘﺳﺍ ﯼﺎﻫ ﺖﯿﺑ ﺩﺍﺪﻌﺗ

:ﺪﻨﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﮓﻧﺭ ﺡﻮﺿﻭ ﯼﺍﺮﺑ ﯽﺘﯿﺑ 32 ﺎﯾ ﯽﺘﯿﺑ 24 ﺭﺍﺰﻓﺍ ﺖﺨﺳ ﺯﺍ ﻥﺭﺪﻣ ﯼﺎﻫﺮﺗﻮﯿﭙﻣﺎﮐ ﻪﻤﻫ

  • ﺕﻭﺎﻔﺘﻣ «ﯽﻌﻗﺍﻭ ﮓﻧﺭ» 16777216 = ﺖﯿﺑ 24

  • ﻒﻠﺘﺨﻣ "ﻖﯿﻤﻋ ﯼﺎﻫ ﮓﻧﺭ" 4,294,967,296=ﺖﯿﺑ 32

.ﺕﻭﺎﻔﺘﻣ "High Colors" ﻦﺷﻮﻟﻭﺯﺭ 65536 :ﺪﻧﺩﺮﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺖﯿﺑ 16 ﺯﺍ ﯽﻤﯾﺪﻗ ﯼﺎﻫﺮﺗﻮﯿﭙﻣﺎﮐ

.VGA ﻒﻠﺘﺨﻣ ﮓﻧﺭ 256 :ﺪﻧﺩﺮﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺖﯿﺑ 8 ﺯﺍ ﯽﻤﯾﺪﻗ ﻩﺍﺮﻤﻫ ﯼﺎﻫ ﻦﻔﻠﺗ ﻭ ﯽﻤﯾﺪﻗ ﺭﺎﯿﺴﺑ ﯼﺎﻫ

ﻝﺎﺜﻣ

:ﺖﯿﺑ ﻪﺑ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﮓﻧﺭ ﻖﻤﻋ ﺶﯾﺎﻤﻧ

document.getElementById("demo").innerHTML = 
"Screen Color Depth: " + screen.colorDepth;

:ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻪﺠﯿﺘﻧ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Screen color depth is " + screen.colorDepth;
</script>

</body>
</html>

.ﺖﺳﺍ (ﻒﻠﺘﺨﻣ ﮓﻧﺭ 16777216) "ﯽﻌﻗﺍﻭ ﯼﺎﻫ ﮓﻧﺭ" ﻩﺪﻨﻫﺩ ﻥﺎﺸﻧ HTML ﺭﺩ ﻩﺩﺎﻔﺘﺳﺍ ﺩﺭﻮﻣ rrggbb (rgb


ﻩﺮﺠﻨﭘ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﻞﺴﮑﯿﭘ ﻖﻤﻋ

.ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﻪﺤﻔﺻ ﻞﺴﮑﯿﭘ ﻖﻤﻋ screen.pixelDepth ﯽﮔﮋ

ﻝﺎﺜﻣ

:ﺖﯿﺑ ﻪﺑ ﺶﯾﺎﻤﻧ ﻪﺤﻔﺻ ﻞﺴﮑﯿﭘ ﻖﻤﻋ ﺶﯾﺎﻤﻧ

document.getElementById("demo").innerHTML =
"Screen Pixel Depth: " + screen.pixelDepth;

:ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﻪﺠﯿﺘﻧ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Screen pixel depth is " + screen.pixelDepth;
</script>

</body>
</html>

.ﺪﻨﺘﺴﻫ ﺮﺑﺍﺮﺑ ﻞﺴﮑﯿﭘ ﻖﻤﻋ ﻭ ﮓﻧﺭ ﻖﻤﻋ ،ﻥﺭﺪﻣ ﯼﺎﻫﺮﺗﻮﯿﭙﻣﺎﮐ ﯼﺍﺮﺑ

تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024