title: Contact between 2 elements in Javascript or jQuery
body: <p>guys, I want to ask how could I update x and y coordinate of moving element so when this moving element hits another element it fades out. Thanks for the help in advance.    </p>
  
  <pre><code>if ($(element1[counter]).position().top &gt;= $("#element2Id").position().top &amp;&amp;
      $(element1[counter]).position().top &lt;= $("#element2Id").position().top + $("#element2Id").height() &amp;&amp;
      $(element1[counter]).position().left == $("#element2Id").position().left) {
      $("#bubble1Id").fadeOut();
  }
  counter++;
  if (counter == 11)
      counter = 0;
  </code></pre>