here is code which i done after searching over google with help of different website.
<script type="text/javascript"> function setCookie(cname,cvalue,exdays) { var d = new Date(); d.setTime(d.getTime()+(exdays*24*60*60*1000)); var expires = "expires="+d.toGMTString(); document.cookie = cname+"="+cvalue+"; "+expires; } windowwidth = document.body.clientWidth; setCookie("wwidth",windowwidth,30); var user1=getCookie("wwidth"); //alert('user1'+user1); </script> <?php $screenWidth = $_COOKIE['wwidth'] ?>
Condition php code
<?php if ($screenWidth <= 660) { ?> <div class="class1" id="content"> <?php } else { ?> <div class="class2" id="content"> <?php } ?>
0 Comments.