Reputation: 57
Hi I have this code that gives a type writing effect. But the thigs is that I want the animation to run only when user scroll down to this div. Would you guys be able to help? Thanks
<script>
$(function(){
$("#typed").typed({
strings: ["oru exp", "Oru expertise", '"Our expertise Graphic Designer will create the template based \n on your company activity and will provide with a proffesional \n and ergonic design to your website."'],
typeSpeed: 30,
backDelay: 500,
loop: false,
// defaults to false for infinite loop
loopCount: false,
callback: function(){ foo(); },
resetCallback: function() { newTyped(); }
});
$(".reset").click(function(){
$("#typed").typed('reset');
});
});
function newTyped(){ /* A new typed object */ }
function foo(){ console.log("Callback"); }
</script>
here is html:
<div class="wrap">
<div class="type-wrap">
<span id="typed" style="white-space:pre;"></span>
</div>
</div>
Upvotes: 0
Views: 484