CMS Development

ben-duchy
Contributeur de premier rang

Isotope filter with Slick Slider

Résolue

A bit of a long shot, but I'm hoping someone has the technical knowhow to come to the rescue.

 

I'm building a new module that uses data from HubDB. To filter this data I'm using the Isotope JS library in a select list. Then to display the information I'm using a Slick Slider carousel. On the face of it, it works as it should, however when you make a new selection from the select list, it only updates one box and not the title / plot above it.

 

I have created a demo on codepen to help demonstrate the issue.

 

https://codepen.io/ben-spriggs/pen/ZEBydgM

 

You’ll see that when you drag the main box across (bottom), it does change the plot number above which works as it should. However, upon changing the site in the select list, only the main slider (bottom) info changes and not the plot / site above it.

I assume it requires some custom JS code but I just don't know it!

0 Votes
1 Solution acceptée
Kevin-C
Solution
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Isotope filter with Slick Slider

Résolue

Hey @ben-duchy 

 

So I think you might have just missed a minor detail!

When you're applying your filters you should also filter the .pno slider:

 

  …
  $('.slick, .pno').slick('slickUnfilter');
  $('.slick, .pno').slick('slickFilter', filterClass);  
  …

 

Using multiple selectors separated by commas is how jQuery allows you to use methods on multiple objects!

 

Hope this gets ya going!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

Voir la solution dans l'envoi d'origine

7 Réponses
Kevin-C
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Isotope filter with Slick Slider

Résolue

Unrelated but…

 

FIRST!

Kevin-C_0-1614020913395.png

 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Votes
dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Isotope filter with Slick Slider

Résolue

If @Kevin-C follows, so do I 😀

Ben_on_CodePen.png

ben-duchy
Contributeur de premier rang

Isotope filter with Slick Slider

Résolue

Thanks @Kevin-C , @dennisedson  - I'll do the same back 😀

Kevin-C
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Isotope filter with Slick Slider

Résolue

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
Kevin-C
Solution
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Isotope filter with Slick Slider

Résolue

Hey @ben-duchy 

 

So I think you might have just missed a minor detail!

When you're applying your filters you should also filter the .pno slider:

 

  …
  $('.slick, .pno').slick('slickUnfilter');
  $('.slick, .pno').slick('slickFilter', filterClass);  
  …

 

Using multiple selectors separated by commas is how jQuery allows you to use methods on multiple objects!

 

Hope this gets ya going!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
ben-duchy
Contributeur de premier rang

Isotope filter with Slick Slider

Résolue
Genius! Thanks @Kevin-C that worked perfectly 👍
dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Isotope filter with Slick Slider

Résolue

Heyo @ben-duchy 

Thanks for providing the pen!

Seems like a fun challenge for someone like @piersg .

0 Votes