How to get screen resolution of visitor in javascript and/or php?

后端 未结 6 963
情话喂你
情话喂你 2020-12-09 14:11

I would like to know the screen resolution of a visitor visiting my page so I can properly make a jquery thickbox cover about 75% of their screen.

Solutions to the q

6条回答
  •  一向
    一向 (楼主)
    2020-12-09 14:56

    In JavaScript it’s:

    screen.width
    screen.height
    

    But PHP has no access to the client. So you need to pass the values gathered by JavaScript to your PHP script.

    Additionally not every user has his windows in full screen mode. So you should better use the available window width/height.

提交回复
热议问题