Combine 2 JS functions
I have the following 2 JS functions and I need to combine them, 1 after
the other. Script 1 loads the DIV, the 2nd script is the animation that I
want to play once the div has loaded:
Here is the first:
<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>
Here is the second:
<script>
$(document).ready(function () {
$('.numbers').delay(1).animate({
'margin-left': '100px'
}, {
duration: 1000,
queue: true
});
});
</script>
Fiddle: http://jsfiddle.net/fatfrank44/wRfu5/2/
Thanks!
No comments:
Post a Comment