Home > Web Front-end > JS Tutorial > body text

jQuery plug-in MixItUp implements animation filtering and sorting_jquery

WBOY
Release: 2016-05-16 16:04:48
Original
2253 people have browsed it

What is MixItUp?

MixItUp is a jQuery plug-in that provides animated filtering and sorting.
MixItUp is great for managing any categorized or sorted content like portfolios, galleries and blogs, but also serves as a powerful tool for working on application user interfaces and data visualizations.
MixItUp plays well with your existing HTML and CSS, making it an excellent choice for responsive layouts.
Rather than using absolute positioning to control layout, MixItUp is designed to work with existing online flow layouts. Want to use percentages, media queries, inline-blocks, or even curved boxes? no problem!

Page code

<div id="Container"> 
  <div class="mix category-1" data-my-order="1"> ... </div> 
  <div class="mix category-1" data-my-order="2"> ... </div> 
  <div class="mix category-2" data-my-order="3"> ... </div> 
  <div class="mix category-2" data-my-order="4"> ... </div> 
</div> 
Copy after login

MixItUp targets the elements in the mixed container with the class. Classification filtering adds custom data properties for class and sort properties.

Build your filter controls:

class="filter" data-filter=".category-1">Category 1 
class="filter" data-filter=".category-2">Category 2 
Copy after login

Filtering occurs when the filter button is clicked.

Build your sort control:

class="sort" data-sort="my-order:asc">Ascending Order 
class="sort" data-sort="my-order:desc">Descending Order 
Copy after login

Sort occurs when the sort button is clicked.

CSS

#Container .mix{ 
  display: none; 
} 
Copy after login

In the item's style, set the target element to have no display attribute. MixItUp will display only those elements that match the current filter.

JS

Example MixItUp using jQuery container:

$(function(){ 
  $('#Container').mixItUp();  
}); 
Copy after login

Using the ID of our container, we can instantiate MixItUp with the jQuery method .mixItUp()

View DEMO Download now

The above is the entire content of this article, I hope you all like it.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!