用户在顶部选择图像。此图像移至“当前元素”。用户选择另一个图像。之前选择的图像移动到“旧元素”:
$('#selected_element_1').css({'position': 'relative', 'top': '-129px', 'left': '40px'})
结果:
<div style="background-color: rgb(204, 204, 204);">
<ul id="CurrentElement" class="chl" style="height: 99px; border: 1px solid blue; position: relative; z-index: 99999;">Top: 237.10000610351562, Left:0Top: 237.10000610351562, Left:0Top: 237.10000610351562, Left:0
Current element.
<li><img id="p_C2" src="img/c/C2.gif" width="80" height="80"></li></ul>
<div id="PlaceHolderElement" style="border: 1px solid fuchsia; position: relative;">
<ul id="CurrentPic" class="chl" style="height: 99px; border: 1px solid blue; position: relative; z-index: 99989; top: -129px; left: 40px;">Top: 237.10000610351562, Left:0Top: 237.10000610351562, Left:0
Current element.
<li><img style="position: relative; z-index: 99989;" id="p_C2" src="img/c/C2.gif" width="80" height="80"></li></ul><ul id="CurrentPic" class="chl" style="height: 99px; border: 1px solid blue; position: relative; z-index: 99989; top: -129px; left: 40px;">Top: 237.10000610351562, Left:0
Current element.
<li><img style="position: relative; z-index: 99989;" id="p_C2" src="img/c/C2.gif" width="80" height="80"></li></ul><ul id="CurrentPic" class="chl" style="height: 99px; border: 1px solid blue; position: relative; z-index: 99989; top: -129px; left: 40px;">
Current element.
<li><img style="position: relative; z-index: 99989;" id="p_C2" src="img/c/C2.gif" width="80" height="80"></li></ul>
Placeholder elements.
<br>
</div>
<div class="_cb"></div>
</div>
但是,我需要: 演示图片:http://forum.jquery.com/topic/relative-offset-animate-problems