Display message on web page when browser innerwidth < innerheight - Javascript CSS Style Property

Javascript examples for CSS Style Property:display

Description

Display message on web page when browser innerwidth < innerheight

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from ww w  .j  av  a2 s.  com

if( window.innerWidth < window.innerHeight) {
    console.log('Try the mobile version: <a href="example.com">click here</a>');
}

    }

      </script> 
   </head> 
   <body>
       Blah blah lorem ipsum  
   </body>
</html>

Related Tutorials