javascript - How can I loop an animation continuously in jQuery? -
i need know how infinitely loop animation. text scroll animation , need repeat after it's finished.
here jquery:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".boxtext").ready(function(){ $(".boxtext").animate({bottom:"600px"},50000); }); }); </script>
here css ".boxtext"
.boxtext { position:absolute; bottom:-300px; width:470px; height:310px; font-size:25px; font-family:trajan pro; color:white; }
make function , have call callback:
$(document).ready(function(){ scroll(); } function scroll() { $(".boxtext").css("bottom", "-300px"); $(".boxtext").animate({bottom:"600px"}, 50000, scroll); }
keep in mind, won't fluid.
edit: wasn't thinking earlier. mistake.
Comments
Post a Comment