• artemi0

    (@artemi0)


    Great job. It works great, but… (there’s always a “but”…)

    I’ve inserted an image into popup, which uses an anchor go to a form in footer.
    I’d like the popup to close after clicking the image and going to the anchor area.

    Is this possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Lovro Hrust

    (@lovor)

    Yes, it is possible.
    Plugin uses Micromodal.js under the hood and you can use Micromodal to close the popup. If you add data-micromodal-close attribute to your image element (you can do so using HTML API) it should work. Another way would be to use javascript to attach click event to image and call Micromodal.close with modal id as parameter. However, I am not sure if you can get reference to Micromodal. If you will have problems with that, I can modify the code to expose it on element.
    Take a look at the plugin source code for reference.

    Thread Starter artemi0

    (@artemi0)

    Wow! Great support!

    I used data-micromodal-close as an attribute, and it closes the popup, but the link stops working.

    NAME: data-micromodal-close-popupcyl
    VALUE:true

    Tou can view this at link

    https://inafo.es/agentes/curso-oposiciones-medioambiental-castilla-leon/

    Thanks a lot

    Plugin Author Lovro Hrust

    (@lovor)

    So, you want that clicking on image take you to another section of the page with id formulario, and closes the popup. You can do this only with javascript. You should use Micromodal.close in click event on image. If scroll still doesn’t work, maybe you’ll also have to call event.preventDefault() and document.querySelector('<selector to your element>').scrollIntoView() or use some different javascript method for scrolling to your element. Let me know if you can reach Micromodal in your code or I’ll have to expose it for you.

    Don’t forget to leave a review for plugin 🙂

    Thread Starter artemi0

    (@artemi0)

    Great support.

    I’ll inform my colleague. I’m not a programmer, it’s not my thing.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.