I got an empty Div called Target :
<div id="target"></div>
and a div called list :
<div id="list">
<ul>
<li><img id="1" src=".." /></li>
<li><img id="2" src=".." /></li>
<li><img id="3" src=".." /></li>
</ul>
</div>
What I want is, on user click, get the img into div target, and adjust his size to something bigger. I can do this easy.
The troubles come where if the user clicks on another div, or another button (arrow or next button elsewhere) I want the 1st div to get back to its place, and be replaced by the new one (or the following in the list, or the 1st if its the last div who’s on display).
I tried a couple of ways but my jQuery ain’t yet good enough.
( before someone ask, everything is local, no server side if this changes anything )
I’m not certain at all if this is the best way or even an efficient way of doing it but it seems to do what you need.
DEMO: Using cloning
As per comments some of the elements could be video files. Instead of using
clone()one can move the elements and leave a place-holder behind.DEMO: Using a place-holder
Edit
Updated demos with actual images.