Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. // -----------
  2. // Debugger that shows view port size. Helps when making responsive designs.
  3. // -----------
  4.  
  5. function showViewPortSize(display) {
  6. if(display) {
  7. //var height = jQuery(window).height();
  8. var width = jQuery(window).width();
  9. jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;background:#ddd;top:48px;right:0;color:black;padding:1px 2px">'+width+'</div>');
  10. jQuery(window).resize(function() {
  11. //height = jQuery(window).height();
  12. width = jQuery(window).width();
  13. jQuery('#viewportsize').html(width+"");
  14. });
  15. }
  16. }
  17.  
  18. showViewPortSize(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement