jQuery在指定位置插入元素动画特效,例如:eq(0)表示第1个元素后插入,可定义为变量,更加灵活。

JS代码
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/jquery.magicmove.js"></script>
<script>
jQuery(function ($) {
$('button.animate1').click(function () {
$('.containers').magicMove({
easing: 'ease',
duration: 300
}, function () {
var index = $(this).children().length + 1;
var $el = $('<section>' + index + 'th</section>');
$(this).find('section').eq(0).after($el);
});
});
$('button.animate2').click(function () {
$('.containers').magicMove({
easing: 'ease',
duration: 500
}, function () {
var index = $(this).children().length + 1;
var $el = $('<section>' + index + 'th</section>');
$(this).find('section').eq(2).after($el);
});
});
$('button.animate3').click(function () {
$('.containers').magicMove({
easing: 'ease',
duration: 500
}, function () {
var index = $(this).children().length + 1;
var $el = $('<section>' + index + 'th</section>');
$(this).find('section').eq(1).after($el);
});
});
});
</script>
恭喜,此资源为免费资源,请先登录
本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有! 若您需要使用非免费的软件、源码或服务,请购买正版授权并合法使用! 本站发布的内容若侵犯到您的权益,请联系站长删除,我们将及时处理! 本站所有资源均是收集而来,资源均不包含技术支持和安装服务!点击下载视为同意资源仅限学习使用。
请先
!