Updating unit tests for offset
This commit is contained in:
parent
c5f4d70e2b
commit
2c2a6253e3
|
@ -28,5 +28,6 @@
|
||||||
<div id="fixed-2" class="fixed"></div>
|
<div id="fixed-2" class="fixed"></div>
|
||||||
<div id="forceScroll"></div>
|
<div id="forceScroll"></div>
|
||||||
<div id="marker"></div>
|
<div id="marker"></div>
|
||||||
|
<p class="instructions">Click the white box to move the marker to it.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -34,6 +34,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="forceScroll"></div>
|
<div id="forceScroll"></div>
|
||||||
<div id="marker"></div>
|
<div id="marker"></div>
|
||||||
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
|
<p class="instructions">Click the white box to move the marker to it.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -15,6 +15,8 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
$('.static').click(function() {
|
$('.static').click(function() {
|
||||||
$('#marker').css( $(this).offset() );
|
$('#marker').css( $(this).offset() );
|
||||||
|
var pos = $(this).position();
|
||||||
|
$(this).css({ position: 'absolute', top: pos.top, left: pos.left });
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -38,6 +38,6 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="marker"></div>
|
<div id="marker"></div>
|
||||||
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
|
<p class="instructions">Click the white box to move the marker to it.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in a new issue