Slide switch of div
来源:互联网 发布:美国近期非农数据预测 编辑:程序博客网 时间:2024/05/16 07:47
http://jsfiddle.net/e3m7K/2/
<div id="container"> <div id="first"> This is the first div </div> <div id="second"> This is the second div </div></div><div id="btnAnimate">Click here to view animation</div>
#container {height: 30px}#container div {border: 1px solid black; width: 200px}#btnAnimate {text-align: center; background-color: #DDDDDD; width : 200px; cursor: pointer; margin: 3px}
function animateLeft($src, $tgt){ var $parent = $src.parent(); var width = $parent.width(); var srcWidth = $src.width(); $src.css({position: 'absolute'}); $tgt.hide().appendTo($parent).css({left: width, position: 'absolute'}); $src.animate({left : -width}, 500, function(){ $src.hide(); $src.css({left: null, position: null}); }); $tgt.show().animate({left: 0}, 500, function(){ $tgt.css({left: null, position: null}); });}$(function(){ var $first = $("#first"); var $second = $("#second"); $second.hide(); $("#btnAnimate").click(function(){ animateLeft($first, $second); var tmp = $first; $first = $second; $second = tmp; });})
0 0
- Slide switch of div
- slide
- slide
- slide
- React Native组件之Switch和Picker和Slide
- The switch statement of JavaScript
- 普元日记----slide滑动时与Div的滑动对应起来
- Hive slide
- HBase slide
- Slide collection
- ruxcon slide
- Slide Over
- instead of WIN7, switch to Ubuntu...
- List of chrome's command line switch
- The color chooser class, you could slide the scroll bars to get the specific numbers of the color
- angularJS中的 resize of div
- switch
- Switch
- win7,64位系统下iis6.0的安装与配置详解,解决“未发现数据源名称并且未指定默认驱动程序”解决办法
- 10月工作状态总结
- Android MaoZhuaWeiBo 好友动态信息列表数据抓取 -3
- Linkedln技术高管Jay Kreps:Lambda架构剖析
- Lambda架构
- Slide switch of div
- Android MaoZhuaWeiBo Adapter ListView优化及发送微博 - 4
- Climbing Stairs
- 程序员每年要做的十件事
- HTML5 textarea placeholder not appearing
- JavaScript function scope between script tags
- ASP.NET中向JS传递参数
- Can I use multiple versions of jQuery on the same page?
- Minimum Path Sum