(JQuery) Offset() coordinates?
<pre><code>$(".div1").hide();
$(".div2").offset( $(".div1").offset() ).slideDown();
</code></pre>

<p>offset() seems to return the current cordinates of an element RELATIVE to the document. Fine. But when I try to use offset(value) to SET the cordinates of an element, it does it relative to the current position of the element, not the document.</p>

<p>In the example code, I tried to place div2 at the same position of div1.</p>

<p>Code:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; 

&lt;html&gt; 

&lt;style&gt;

div{margin-bottom: 2px; height: 70px}
.red{background-color: red}
.blue{background-color: blue}
.green{background-color: green}
.orange{background-color: orange}
.pink{background-color: pink}

.msg{background-color: skyblue; border: 1px solid black; border-radius: 5px; display: none}
&lt;/style&gt;

&lt;script type="text/javascript" src="/scripts/jquery-1.6.2.min.js"&gt;&lt;/script&gt;
&lt;script&gt;
$(function(){   
    $(".msg").offset( $(".blue").offset() ).slideDown(); 

});
&lt;/script&gt;

&lt;body&gt;

&lt;div class="red"&gt;&lt;/div&gt;
&lt;div class="blue"&gt;&lt;/div&gt;
&lt;div class="green"&gt;&lt;/div&gt;
&lt;div class="orange"&gt;&lt;/div&gt;
&lt;div class="pink"&gt;&lt;/div&gt;

&lt;div class="msg"&gt;
    TEST
&lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;
</code></pre>
