jquery - Content show/hide with animation -
i've created fiddle. want know if i'm doing right way.
here code,
<div class="container"> <div>sadness emotional pain associated with, or characterized feelings of disadvantage, loss, despair, helplessness , sorrow.</div> <div>sadness common experience in childhood. acknowledging such emotions can make easier families address more serious emotional problems,[3] although families may have (conscious or unconscious) rule sadness "not allowed".[4] robin skynner has suggested may cause problems when "screened-off emotion isn't available when need it... loss of sadness makes bit manic".</div> <div>sadness part of normal process of child separating symbiosis mother , becoming more independent. every time child separates tiny bit more, or have cope small loss.</div>
js:
delay=2000; function repeat(){ visibletextblock=$('.container div:visible'); visibletextblock.fadeout(); visibletextblock.next().fadein(); } ; t=settimeout(function(){ repeat(); settimeout(function(){ repeat(); },delay); },delay);
please try this.
delay=2000; i=setinterval(function(){ visibletextblock=$('.container div:visible'); visibletextblock.fadeout(); visibletextblock.next().length>0 ? visibletextblock.next().fadein() : $('.container div:first').fadein(); },delay);
Comments
Post a Comment