Saturday, March 12, 2016

detect browser dimension using jquery

This tutorial will help you check width and height of the browser,  
First of all include jquery.min.js inside your <head> or <body> 

Step: 1 JQUERY
   $('#browserInfo').text('Browser (Width : '
                + $(window).width() + ' , Height :' + $(window).height() + ' )');
 
    $(window).resize(function () {
  $('#browserInfo').text('Browser (Width : ' + $(window).width() 
                                 + ' , Height :' + $(window).height() + ' )');
    });

Step: 2 HTML


Now resize your browser to check browser width and height.
Finished!



No comments:

Post a Comment

Copyright © www.sureshsharma.info All rights reserved