You have to either do the if else completely in javascript or use javascript to pass the width to php.
Method 1:
<html>
<body>
<script type="text/javascript">
var w = 0;
if (window.innerWidth) w = window.innerWidth;
else if (document.all) w = document.body.clientWidth;
if (w < 1008) { document.write("less than 1008"); }
else { document.write("more than 1008"); }
</script>
</body>
</html>
PHP detect browser window size, $_Get['width'] ??
Apr 30 2009, 12:21 PM
Quote
0.0951sec
1.17
6 queries
GZIP Disabled