2014-03-06 47 views
1

我跟着本教程中的指令来获取MixItUp工作: https://mixitup.kunkalabs.com/learn/tutorial/get-started/jQuery插件MixItUp不工作

我只是试图让过滤工作,但我不知道我做错了什么。

这里是我的小提琴:http://jsfiddle.net/LY2Nj/

<div class="controls"> 
    <button class="filter" data-filter="all" type="button"> 
    Show all 
    </button> 
    <button class="filter" data-filter=".yellow" type="button"> 
    Yellow 
    </button> 
    <button class="filter" data-filter=".green" type="button"> 
    Green 
    </button> 
    <button class="filter" data-filter=".red" type="button"> 
    Red 
    </button>  
</div> 

<div id="color-container"> 
    <div class="mix yellow"> 
     <p>Yellow</p> 
    </div> 
    <div class="mix green"> 
     <p>Green</p> 
    </div>  
    <div class="mix red"> 
     <p>Red</p> 
    </div>  
</div> 

JS

$(document).ready(function(){ 
    // Start mixitup 
    $('#color-container').mixItUp(); 
}); 

CSS

#color-container .mix{ 
    display: none; 
} 
+0

我遇到了Mixitup过滤器的问题:我的元素在应用过滤器时重新出现。使用display:none属性来忘记.mix CSS类。 – gogson

回答