title: How to use "object.addEventListener("resize", myScript)" for a div element?
body: <p>before i was trying to add this event listener to a div</p>
  
  <p>i was using "scroll", this one  works but "resize" is not working </p>
  
  <p>and i can't find out why . </p>
  
  <p>This is my code : </p>
  
  <pre><code>$('document').ready(function() {
  
    var content = document.getElementById("scroller");
    var tabs = document.getElementById("tabs");
  
    var than, now;
    than = tabs.clientHeight;
  
    content.addEventListener("resize", function(event) {
      now = tabs.clientHeight;
  
      alert(now + "&amp;" + than);
    }, false);
  
  
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/FVfSL/1824/" rel="nofollow">JSFIDDLE DEMO</a></p>
  
  <p>or is it possible something like this : </p>
  
  <pre><code>$('document').ready(function(){ 
  
                  var content = document.getElementById("scroller");
                  var hc , h;
  
                  window.addEventListener('resize', function(event){
  
                      h = event.clientHeight;
                 if(h&gt;510) {
                  $(".godown").fadeout("0");
                      }
                 if(h&lt;510) {
                  content.addEventListener('scroll', function(event){
                   hc =  $('#scroller').scrollTop();
  
  
  
  
  
  
                      if (hc){
                     $(".godown").fadeOut("slow");
                     $(".gotop").fadeIn("slow");
                      }
   if (!hc){
                     $(".godown").fadeIn("slow");
                     $(".gotop").fadeOut("slow");
  
  }
               }, false);
   }
                      }, false);
              });
  </code></pre>