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

后端 未结 6 971
情话喂你
情话喂你 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:39

    If you are using jQuery, there is cross-browser solution to get the browser window size:

    var browserWidth = $(window).width();
    var browserHeight = $(window).height();
    

提交回复
热议问题