title: Get variable resizing image width and height with jquery
body: <p>i have a function that runs on load and window resize. I want to use the new values ​​after resizing it to another variable. I did not get the sizing part of the values​​. </p>
  
  <pre><code>$(window).load(function(){
             var a=imageSize();
             getResizeImageWidthHeight(a);
              otherFunction();    
          });
          $(window).resize(function(){
              imageSize();
  
          });
  </code></pre>
  
  <p>image resize </p>
  
  <pre><code>var imageSize =function() {
              var status='0';
              if( $(window).width()-300 &gt; $(window).height() ) {
                  $('#images').css({
                      'width': 'auto',
                      'height': ( $(window).height() )+'px'
                  });
                  status='1';
              }
              else {
                  $('#images').css({
                      'width': ( $(window).width() )+'px',
                      'height': 'auto'
                  });
                  status='2';
              }
              return status;
  
          }
  </code></pre>
  
  <p>get resize image width and height </p>
  
  <pre><code>function getResizeImageWidthHeight(a) {
             x=a;
             if(x=='1') {
                      $("#images").load(function() {
                          imgWidth = this.width;
                          alert( "imgWidth: " + imgWidth );
                      });
                  var imgHeight = $("#images").height();
  
              } else if(x=='2') {
                      $("#images").load(function() {
                          var imgHeight = this.height;
                      });
                  var imgWidth = $("#images").width();
                  alert( " imgHeight: " + imgHeight);
              } 
          }
  </code></pre>
  
  <p>and using function </p>
  
  <pre><code>function otherFunction() {
              var xWidth=imgWidth*2;
              var xHeight=imgHeight*3;
              .
              .
              etc. 
          }
  </code></pre>