i stuck code trying on since day. code change text after 1s of html element. , stuck in adding animation changing text.
<h1>your favorite source of<span id="changingtext"></h1> i targeting #changingtext element jquery.
(function () { var texts = ["one", "two", "three", "four"]; var count = 0, interval = 1000; addtext(); function addtext() { var usrtxt = $("#changingtext"); usrtxt.animate({margintop:-10}, "fast"); usrtxt.animate({margintop:0}, "fast"); usrtxt.animate({margintop:-5}, "fast"); usrtxt.animate({margintop:0}, "fast"); usrtxt.text(texts[count]); count += count < 3 ? 1 : -3; settimeout(addtext, interval); }}()); i want text animate bounce effect everytime changes. tried using animate.css not able add class this.
please help.
thank you.
are sure code right?
the tag span not closed.
you code <h1>your favorite source of<span id="changingtext"></h1>
the rigth 1 should <h1>your favorite source of<span id="changingtext"></span></h1>
if code right in source file, can try method this. html dom.
htmlelement.innerhtml="new text!";
Comments
Post a Comment