malsup / cycle2

2nd gen cycling
899 stars 236 forks source link

Slideshow doesnt init if loader is set to wait #714

Open ghost opened 9 years ago

ghost commented 9 years ago

In my current project im using wordpress and when I visit the slider page over the menu the slideshow isnt initializing. To initialize it, i have to do do a hard refresh. I figured out, that the problem belongs to the loader options which was set to "wait".

$("#beer-slider").cycle({
        fx: "scrollHorz",
        speed: 500,
        timeout: 0,
        pauseOnHover: true,
        prev: "#prev-slide",
        next: "#next-slide",
        swipe: true,
        swipeFx: "scrollHorz",
        slides: "> .slide",
        autoHeight: "960:718",
        log: false,
        loader: "wait" //isnt working.
    });

Though my markup is a bit strange so maybe the problem appears in addition to it.

<div id="beer-slider">
    <?php foreach( $slides as $slide ): ?>
        <div class="slide">
            <div class="image">
                <img src="<?php echo $slide["product_img"]; ?>" alt="<?php echo $slide["title"]; ?>">
            </div>
            <div class="information">
                <h1><?php echo $slide["title"]; ?></h1>
                <h2><?php echo $slide["subtitle"]; ?></h2>
                <a href="<?php echo $slide["perma"]; ?>" class="more-link">
                    mehr erfahren
                </a>
            </div>
        </div>
    <?php endforeach; ?>
        <a id="prev-slide" class="control-btn control-left slider-overlay-layer"></a>
        <a id="next-slide" class="control-btn control-right slider-overlay-layer"></a>

    </div>

Despite that problem, thank you very much for your nice plugin. It helps me a lot.