here is code which i done after searching over google with help of different website.
1 2 3 4 5 6 7 8 9 10 11 12 13 | <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
1 2 3 4 5 | <?php if ( $screenWidth <= 660) { ?> <div class = "class1" id= "content" > <?php } else { ?> <div class = "class2" id= "content" > <?php } ?> |
0 Comments.