通过不同的容器使用 jQuery 交换或移动 DOM 元素
伙计们,我有下一个 HTML:
<div id="Dummy" class="video">
<div class="videoDummy">Video Dummy</div>
</div>
<div class="bd">
<ul class="items">
<li class="video">
<a href="#" class="launch-video vid_{{VAR:vid_contentId}}">
{{module:video_imagethumbnail/contentId={VAR:contentId}}·clippingWidth=68}}
</a>
<div class="data">
<div class="player">
{{MODULE:Flashmedia/contentId=VAR:vid_contentId}}·type=video}}
</div>
</div><!-- .data -->
</li>
<li class="video">
<a href="#" class="launch-video vid_{{VAR:vid_contentId}}">
{{module:video_imagethumbnail/contentId={VAR:contentId}}·clippingWidth=68}}
</a>
<div class="data">
<div class="player">
{{MODULE:Flashmedia/contentId=VAR:vid_contentId}}·type=video}}
</div>
</div><!-- .data -->
</li>
<!-- ... and so on --->
</ul>
</div>
我需要将 div“data”内的内容与上面的一个 div“Dummy”或 videoDummy 交换,并在用户单击下一个/上一个链接(类启动视频)。
我将如何使用 jQuery 或 javascript 来完成此操作?
guys, I have the next HTML:
<div id="Dummy" class="video">
<div class="videoDummy">Video Dummy</div>
</div>
<div class="bd">
<ul class="items">
<li class="video">
<a href="#" class="launch-video vid_{{VAR:vid_contentId}}">
{{module:video_imagethumbnail/contentId={VAR:contentId}}·clippingWidth=68}}
</a>
<div class="data">
<div class="player">
{{MODULE:Flashmedia/contentId=VAR:vid_contentId}}·type=video}}
</div>
</div><!-- .data -->
</li>
<li class="video">
<a href="#" class="launch-video vid_{{VAR:vid_contentId}}">
{{module:video_imagethumbnail/contentId={VAR:contentId}}·clippingWidth=68}}
</a>
<div class="data">
<div class="player">
{{MODULE:Flashmedia/contentId=VAR:vid_contentId}}·type=video}}
</div>
</div><!-- .data -->
</li>
<!-- ... and so on --->
</ul>
</div>
I need to swap the content inside div "data" with the one upper div "Dummy" or videoDummy, and bring it back the content without lose data when user click the next/previous one link (class launch-video).
How would I go about doing this whith jQuery o javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的意思是这样的吗?
You mean something like this?