title: calculate height and apply to a div with jquery
body: <p>I have a banner image that is only visible when i set a fixed height, i want to make it responsive so the only way i thought of doing that is calculating the height of the image with the width of the window.</p>
  
  <p>the function to calculate the height is: windowWidth/1.845</p>
  
  <p>how do i apply that function to a div css with jquery/javascript?</p>
  
  <p>i tried this function but it didn't work </p>
  
  <pre><code>    $(document).ready(function(){
    var originalWidth = $( window ).width();
    var newHeight = originalWidth/+(1.845)
  ; 
  
  
    function resize() {
      $("#ei-slider").css("height", newHeight); 
  
    }
  
    $(".target").each(resize);
    $(document).resize(function(){
        $("ei-slider").each(resize);
    });
  });
  </code></pre>