Track window size with jquery is simple.You can use this method to achive many things in your website.
Jquery
$(document).ready(function(e) { $win_w=$(window).width(); $win_h=$(window).height(); $('#window-width').html("Window Width : "+$win_w); $('#window-height').html("Window Height : "+$win_h); }); $(window).resize(function(){ $win_w=$(window).width(); $win_h=$(window).height(); $('#window-width').html("Window Width : "+$win_w); $('#window-height').html("Window Height : "+$win_h); });
HTML
Download File Used in this example View Live DemoResize window to check realtime window size
No comments:
Post a Comment