jquery - reloading the masonry container after showing new items doesn't work? -
Here's a bit of a problem. When the site loads for the first time, I should have a bunch of hidden items, and after clicking on only one button it appears on top of my doctor. I have this:
$ ('# showall'). Hide ();
That successfully hides those cards that I have hidden (obviously). So I tried to hide them and reload the masonry container but it does not work.
var container = document.query selector ('comparison-card'); Var msnry = new masonry (container, {// option item selector: 'card', gutter: 20, hectuff: true}); $ ('.button'). Click (function () {$ ('# showall'). Show (); msnry.reloadItems ();});
Is there any reason, will not it work? Am I doing something wrong? Is there a better way to do this? For clarification, the cards I have hidden have belong to the same category as I have initially shown a different ID to the card shown.
Thanks for any help! : -)
I am able to resolve it by combining jquery show () and hide () Click (function () {if (buttonClicked == false) {$ (testArray) .show (); Msnry.addItems (testArray); $ (container) .append (testArray); msnry.appended (testArray); Msnry.reloadItems (); msnry.layout (); $ ('.button') .html ('show less'' button; pinch = true; console.log (buttonclotted);} other {MSNRI.rem (tester); MSNE Layouts (); $ ('.button') .HTML ('Show All'); ButtonClickKit = Wrong; Console.log (ButtonCloth);}});
Comments
Post a Comment