2017-10-24 8 views
0

私はZeptoで私のサイトにSiema carouselを使用しています。私はユーザーが現在どのスライドを表示しているかを示すことができます。 onChangeイベントのみが利用可能な場合はどうすればよいですか?Siema Caインジケータ

HTML

<section class="images"> 
    <img/> 
    <img/> 
</section> 

<section class="indicators"> 
    <span class="active"></span> 
    <span></span> 
</section> 

JS

$(document).ready(function() { 
    new Siema({ 
    selector: '.images', 
    onChange:() => { 
     console.log("swiped"); 
     // change active indicator? 
    }, 
    }); 
}); 
+0

顔をしています。これはあなたが探している行動の例を持っているはずです。 – Joffutt4

答えて

0

私は(私はSiemaの著者だ)を助けることができると思います。

// extend a Siema class and add addDots() & updateDots() methods 
const mySiemaWithDots = new SiemaWithDots({ 

    // on init trigger method created above 
    onInit: function(){ 
    this.addDots(); 
    this.updateDots(); 
    }, 

    // on change trigger method created above 
    onChange: function(){ 
    this.updateDots() 
    }, 

}); 

​​

現在のスライドの[Siemaカルーセル](https://github.com/pawelgrzybek/siema)のAPIセクションの下で素敵な一日