fadein - jQuery Fade in trouble (Works in second rotation but not first) -
ok, deal content , front end design trying throw nice image slider iframe our website. able construct using jquery having small problem it. supposed have fade in , fade out during first rotation uses fade out. next rotation works perfectly.
here code i'm using
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ slideshow(); }); function slideshow() { var showing = $('#contentcontain2 .isshowing'); var next = showing.next().length ? showing.next() : showing.parent().children(':first'); showing.fadeout(800, function() { next.fadein(1600).addclass('isshowing'); }).removeclass('isshowing'); settimeout(slideshow, 5000); } </script>
here link hosted can see problem.
try hiding them first (before fade them in). think that's culprit, explain why fade in after being faded out in first cycle (but not before). can't "fade in" full opacity.
$(document).ready(function(){ $("#contentcontain2").children("img").not(".isshowing").hide(); // hide em slideshow(); }); function slideshow() { var showing = $('#contentcontain2 .isshowing'); var next = showing.next().length ? showing.next() : showing.parent().children(':first'); showing.fadeout(800, function() { next.fadein(1600).addclass('isshowing'); }).removeclass('isshowing'); settimeout(slideshow, 5000); }
Comments
Post a Comment