Reputation: 8070
I created the div with class of font-style within this contain message. for example:
<div class="font-style" style=position:relative>
Hi all How are you !!!
</div>
And the Jquery is
jQuery('.font-style').css({'right': '0px', 'left': '300px'}).animate({
'right': '300px'
});
jQuery('.font-style').css({'right': '300px', 'left': '0px'}).animate({
'left': '300px'
});
On Load it appear center and after it moves from right to left and after that left to right. It working perfect but my question is how to make it as center after it move from left to right.
Upvotes: 1
Views: 3399
Reputation:
jQuery('.font-style').animate({
'right': '300px'
},'slow').animate({
'left': '300px'
},'slow').animate({
'left': '0',
'right': '0'
});
<div style="width:100%" id="p">
<div class="font-style" style=position:relative>Hi all How are you !!!</div>
</div>
#p{text-align:center;}
font-style{
}
Upvotes: 3