[Hustle] Cannot open popup on image click

We want a Hustle popup to open when images (in a gallery) are clicked. We’re using a gallery plugin and it allows us to set a link for the images, but Hustle doesn’t provide a way to set up a direct link that opens the popup.

For CSS selectors (classes and IDs) as click triggers, unfortunately, the gallery plugin doesn’t let us set CSS selectors for the images. Is there a way, using custom code, that I can target these images in the gallery?

  • Predrag Dubajic
    • Support

    Hi Greg,

    You can use nth-of-type in class selector and that should do the trick to trigger it for specific gallery element.

    In your case where you have 6 elements the trigger selectors would look like this:

    .wl-gallery:first-of-type
    .wl-gallery:nth-of-type(2)
    .wl-gallery:nth-of-type(3)
    .wl-gallery:nth-of-type(4)
    .wl-gallery:nth-of-type(5)
    .wl-gallery:last-of-type

    For example, let's say you want a popup to open up on the fifth element, you will use .wl-gallery:nth-of-type(5) like this:

    [attachments are only viewable by logged-in members]

    Best regards,

    Predrag