LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
Raw resize events
Debounced events
CSS
body {
  background: #444444;
  color: white;
  font: 15px/1.51 Helvetica, sans-serif;
  margin:0 auto;
}
.left-panel,
.right-panel {  
  padding:2%;
  margin:0;
  width:46%;
  float:left;
  min-height:100vh;
  text-align:center;
}

.left-panel {
  background: #ccc;
  color:black;
}
JS
// Based on http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/
$(document).ready(function(){
  
  var $win = $(window);
  var $left_panel = $('.left-panel');
  var $right_panel = $('.right-panel');
  
  function display_info($div) {
    $div.append($win.width() + ' x ' + $win.height() +  '
'); } $(window).on('resize', function(){ display_info($left_panel); }); $(window).on('resize', _.debounce(function() { display_info($right_panel); }, 400)); });
Term
Tue, 11/28/2017 - 13:42

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv