title: Find out if an image is horizontal or vertical
body: <p>I have multiple images and want to find out if each image horizontal or vertical and add a class to it so I can style it accordingly.</p>
  
  <p>I tried multiple things including something like this:</p>
  
  <pre><code>if ($(".img").width() &gt; $(".img").height()) {
  $(this).addClass("horizontal");
  }
  </code></pre>
  
  <p>What am I doing wrong? Thank you!</p>