Last slide in slideshow not fading...


i building website client , jquery simple fade slideshow using working fine until added links slides, @ end of slideshow rather fade first slide again, slide changes, fade mechanism disabled last slide. if can me resolve issue i'd appreciate it!

 

http://nycanimalnews.com/

 

thanks in advance!

michael

 

   <div id="body_left">
   <div align="left">
           
<script type="text/javascript">
$(function() {
    var $slideshow = $('#slideshow'),
    $slides = [],
    active = null;
   
    // build slides array children of slideshow.  pull in children, adjust scope if needed
    $slideshow.children().each(function(i) {
        var $thisslide = $(this);
       
        // if active slide set index
        if ( $thisslide.hasclass('active') ) active = i;
       
        $slides.push( $thisslide );
    });
   
    // if no active slide, take last one
    if ( active === null ) active = $slides.length - 1;
   
    function slideswitch() {
        // add last-active class active slide
        var $lastactive = $slides[active];
        $lastactive.addclass('last-active');
       
        // find next slide
        active++;
       
        // set 0 if it's high
        if ( active >= $slides.length ) active = 0;
       
        var $nextactive = $slides[active];
   
        $nextactive.css({opacity: 0.0})
            .addclass('active')
            .animate({opacity: 1.0}, 1000, function() {
                $lastactive.removeclass('active last-active');
            });
    }

    // start interval
    setinterval( slideswitch, 6000 );
});

//-->
</script>

   <div id="slideshow">
           
            <a href="https://www.google.com/" class="active"><img src="images/homepage/service slates/grooming.jpg" alt="grooming"/></a>
         <a href="http://www.yahoo.com/"><img src="images/homepage/service slates/boarding.jpg" alt="boarding"/></a>
            <a href="http://www.bing.com/"><img src="images/homepage/service slates/brands.jpg" alt="brands"/></a>
            <a href="http://www.cnn.com/"><img src="images/homepage/service slates/cat sitting.jpg" alt="cat sitting"/></a> 
                     
            </div>
  
            </div>
   </div>



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support