简体   繁体   中英

Repeat the fade effect in accordion

I have a fade slide show of content inside the carousel li.

Fade slideshow works fine first time but when it is repeating second time the slideshow div is not showing at all.

Code used

 var quotes = $(".inner_detail div");
    var quoteIndex = -1;

    function showNextQuote() {
        ++quoteIndex;
        quotes.eq(quoteIndex % quotes.length)
            .fadeIn(2000)
            .delay(2000)
            .fadeOut(2000, showNextQuote);
    }

    showNextQuote();    
//Slider
    $('#news-container').vTicker({ 
        speed: 800,
        pause: 6000 * quotes.length-1,
        animation: 'fade',
        mousePause: false,
        showItems: 1
    });

Here is the FIDDLE

Wait until it finish the 3 slide downs and then when it starts the first li again then the fade div is not showing.

Working DEMO here http://jsfiddle.net/yeyene/mvNEE/39/ .

Clean your html codes, no need to use ul li, just use all divs.

Coz your are already using $(".inner_detail div").

HTML

<div class="editorial" id="news-container">
    <!-- This is the slide show-->
    <div class="inner_detail">
        <!--First book-->
        <div>
            <img src="http://platform-testing4.s3.amazonaws.com/amazon/books/BR_Image1.jpg">
            <h1>Thrilling, Brave, and Controversial</h1>
            <span>30 Pieces of Silver: An Extremely Controversial Historical Thriller</span> 
        </div>

        <!--Second book-->
        <div>
            <img src="http://platform-testing4.s3.amazonaws.com/amazon/books/BR_Image2.jpg">
            <h1>Not quite What I Expected.</h1>
            <span>The Book of Shadows : The Unofficial Charmed Companion</span> 
        </div>

        <!--Third book-->
        <div>
            <img src="http://platform-testing4.s3.amazonaws.com/amazon/books/BR_Image3.jpg">
            <h1>I would give it many more than five stars.</h1>
            <span>The Red Tent</span> 
        </div>

        <div> 2) Lorem ipsum dolor sit amet, consectetur adipiscing elit. more info </div>

        <div> 3) Lorem ipsum dolor sit amet more info more info more info more info </div>
    </div>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM