我有以下 2 个 JS 函数,我需要将它们组合起来,一个接一个。脚本 1 加载 DIV,第二个脚本是我要在 div 加载后播放的动画:
这是第一个:
<script>
$(document).ready(function() {
var controller = $.superscrollorama();
// individual element tween examples
controller.addTween('#container', TweenMax.fromTo( $('#container'), .25, {css:{opacity:0, scale:0, }, immediateRender:true, ease:Quad.easeInOut}, {css:{opacity:1, scale:1}, ease:Quad.easeInOut}));
controller.addTween('#container2', TweenMax.fromTo( $('#container2'), .25, {css:{opacity:0, scale:0, }, immediateRender:true, ease:Quad.easeInOut}, {css:{opacity:1, scale:1}, ease:Quad.easeInOut}));
});
</script>
这是第二个:
<script>
$(document).ready(function () {
$('.numbers').delay(1).animate({
'margin-left': '100px'
}, {
duration: 1000,
queue: true
});
});
</script>
小提琴:http: //jsfiddle.net/fatfrank44/wRfu5/2/
谢谢!