title: Trouble with logic in this conditional statement
body: <p>How would I need to write this code so that the alert message doesn't display when the earth element is vertically aligned with the sun element, but rather when the earth element has the same horizontal and vertical coordinates.</p>
  
  <p>I've tried using  both the <code>.position()</code> and <code>.offset()</code> methods, didn't work. You would think using same left positions AND top positions would do the trick, but the alert message pops up when the left position conditional statement is met.</p>
  
  <p>Im having trouble properly writing the conditional statement.</p>
  
  <pre><code>var positionplanet = $("#Earth").position();
  var positionsun = $("#Sun").position();
  
  if (
      Math.round(positionplanet.left) == Math.round(positionsun.left) &amp;&amp;
      Math.round(positionplanet.top) == Math.round(positionplanet.top)
  ) {
      alert("planet and sun are on the same spot");
  }
  </code></pre>