Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

isotope cdn

// isotope cdn
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>

// init Isotope (portfolio-items)
var $grid = $('.grid').isotope({ });

// filter items on button click
$('.filter-button-group').on( 'click', 'button', function() {
  var filterValue = $(this).attr('data-filter');
  $grid.isotope({ filter: filterValue });
});

// add class active  in button 
 $('.portfolio-filter button').click(function () {
 $(this).addClass("active");
 $(this).siblings().removeClass('active');
 });

//isotope button list html
<div class="button-group filter-button-group">
  <button data-filter="*">show all</button>
  <button data-filter=".metal">metal</button>
  <button data-filter=".transition">transition</button>
  <button data-filter=".alkali, .alkaline-earth">alkali & alkaline-earth</button>
  <button data-filter=":not(.transition)">not transition</button>
  <button data-filter=".metal:not(.transition)">metal but not transition</button>
</div>

// isotope html containt
<div class="grid">
  <div class="element-item transition metal">...</div>
  <div class="element-item post-transition metal">...</div>
  <div class="element-item alkali metal">...</div>
  <div class="element-item transition metal">...</div>
  <div class="element-item lanthanoid metal inner-transition">...</div>
  <div class="element-item halogen nonmetal">...</div>
  <div class="element-item alkaline-earth metal">...</div>
  ...
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: refresh page by hand in react 
Javascript :: ifsc code validation regex 
Javascript :: difference between let and var 
Javascript :: jquery form data 
Javascript :: forjs check if key in json 
Javascript :: javascript define global variable 
Javascript :: create csv file javascript 
Javascript :: react state array 
Javascript :: export csv in react 
Javascript :: tolocaledatestring format dd-mm-yyyy 
Javascript :: how to ssh into gke node 
Javascript :: json stringify close circle 
Javascript :: change port react app 
Javascript :: settimeout function javascript for loop 
Javascript :: how to pass the data from one page to another in javascript 
Javascript :: how to find repeated characters in a string in javascript 
Javascript :: add new items in a select input using js 
Javascript :: flatten array recursively 
Javascript :: .textcontent in javascript 
Javascript :: random coordinates js 
Javascript :: javascript capitalize 
Javascript :: find and filter in javascript 
Javascript :: poo js 
Javascript :: javascript indexof with condition 
Javascript :: npm error Could not resolve dependency peer react@"^18.0.0" from react-test-renderer@18.0.0 
Javascript :: get first element in json array javascript 
Javascript :: loop through json array and get key name 
Javascript :: store input into array javascript 
Javascript :: move canvas element to mouse 
Javascript :: click a link with javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =