How to move an object continuosly using jQuery
I have a HTML page which has a title. I want to mov开发者_开发百科e the title horizontally using jQuery, until I close the browser. How can I do this?
Thanks..
I would use animate
DEMO
HTML
<div id="title">Title</div>
CSS
div
{
position: absolute;
}
Javascript
anititle();
function anititle()
{
$("#title").animate(
{"right": "+=770px"},
{duration: 5000,
complete: function()
{
$("#title").animate(
{"right": "-=770px"},
{duration: 5000,
complete: function()
{
anititle();
}});
}});
}
Source
Here #title is the ID of the html element holding your title text.
精彩评论