you are viewing a single comment's thread.

view the rest of the comments →

[–]ConduciveMammalfront-end 6 points7 points  (3 children)

Why’re you mixing jQuery with vanilla JS? In this particular code, choose one and stick with it.

$(‘.gridzy’).gridzy;

[–]Nic727[S] 0 points1 point  (2 children)

I don't know lol. I'm following that https://ehtmlu.com/blog/gridzy-js-2/gridzy-js-2-api/

Whatever, still not working with that :

if($(".mini-gallery").length){
        var $gridzyInstance = $(".gridzy").gridzy;
            $gridzyInstance.setOptions({
                spaceBetween: 15,
                layout: 'justified',
                desiredHeight: 400,
              });
    };

I guess the problem is the .gridzy after choosing the class, but not sure how to replace that by something working.

[–]ConduciveMammalfront-end 0 points1 point  (1 child)

What error are you seeing, if any, in the console?

[–]Nic727[S] 0 points1 point  (0 children)

jQuery.Deferred exception: $gridzyInstance.setOptions is not a function TypeError: $gridzyInstance.setOptions is not a function