jQuery插件MixItUp无法正常工作

时间:2014-03-06 16:54:26

标签: jquery jquery-plugins

我按照本教程中的说明使MixItUp工作: https://mixitup.kunkalabs.com/learn/tutorial/get-started/

我只是想让过滤工作,但我不确定我做错了什么。

这是我的小提琴: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;
}

1 个答案:

答案 0 :(得分:2)

通过添加外部MixItUp核心脚本,我能够让你的小提琴工作:

http://cdn.jsdelivr.net/jquery.mixitup/latest/jquery.mixitup.min.js