Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot update Offset using JQuery in Internet Explorer 10
    primarykey
    data
    text
    <p>I'm trying to set an the offset of an element. The code works ok in Chrome but i can't get the offset to change in IE;</p> <pre><code>this.moveH = function (e) { if (this.target != null){ console.log(this.target.offset()) this.target.offset({ left: e.pageX - this.target.outerWidth(true) / 2, top: e.pageY - this.target.outerHeight(true) / 2 }); } console.log(this.target.offset()) e.preventDefault(); } </code></pre> <p>If i run in chrome the first console.log is different from the second. If i run in IE it never changes. Thank you</p> <p><strong>Update 1</strong> The offset function is the one from JQuery</p> <p><strong>Update 2</strong> Added HTML and CSS</p> <pre><code>*{ margin:0px; left:0px; right:0px; } #applet { position: absolute; width: 700px; height: 520px; direction:ltr; text-align: center; } #puzzle{ top:80px; left:20px; position:absolute; } .left-column{ position:absolute; width:388px; } .left-puzzle{ margin-top:10px; width:388px; background-image:url("../images/left_puzzle.png"); height:83px; } .left-puzzle p{ margin-right:194px; } .right-column{ float:right; left:500px; width:182px; margin-right:10px; } .targets{ left:206px; top:1px; width:194px; position:absolute; } .target{ margin-top:10px; width:194px; height:83px; } .right-puzzle{ margin-top:10px; width:182px; height:82px; background-image:url("../images/right_puzzle.png") } #bg{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </code></pre> <p>HTML</p> <pre><code>&lt;div id='applet'&gt; &lt;img id='bg' src='images/background.jpg' /&gt; &lt;div id="puzzle"&gt; &lt;div class="left-column"&gt; &lt;div class="left-puzzle"&gt; &lt;p&gt;يبدأ خلف الشرج ولدى بعض الحبليات ذيل يوجد في مرحلة الجنين فقط.&lt;/p&gt; &lt;/div&gt; &lt;div class="left-puzzle"&gt; &lt;p&gt;يمتد بطول الظهر وهو مليء بالسائل عند الفقاريات ويطلق عليه اسم الحبل الشوكي .&lt;/p&gt; &lt;/div&gt; &lt;div class="left-puzzle"&gt; &lt;p&gt;تتطور إلى خياشيم أو إلى أجزاء أخرى من الجسم أثناء تطور الجنين .&lt;/p&gt; &lt;/div&gt; &lt;div class="left-puzzle"&gt; &lt;p&gt;قضيب صلب لكنه مرن يدعم الجسم وفي الفقاريات يحل محله عمود فقري .&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="targets"&gt; &lt;div class="target drop" id="t1"&gt;&lt;/div&gt; &lt;div class="target drop" id="t2"&gt;&lt;/div&gt; &lt;div class="target drop" id="t3"&gt;&lt;/div&gt; &lt;div class="target drop" id="t4"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="right-column"&gt; &lt;div id="d1" class="right-puzzle drag" data-target-id="t2"&gt; &lt;p&gt;الحبل العصبي المجوف&lt;/p&gt; &lt;/div&gt; &lt;div id="d2" class="right-puzzle drag" data-target-id="t1"&gt; &lt;p&gt;الذيل&lt;/p&gt; &lt;/div&gt; &lt;div id="d3" class="right-puzzle drag" data-target-id="t3"&gt; &lt;p&gt;الجيوب البلعومية &lt;/p&gt; &lt;/div&gt; &lt;div id="d4" class="right-puzzle drag" data-target-id="t4"&gt; &lt;p&gt;الحبل الظهري&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload