Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Add JS for make a modal in a plugin

Started by andre_ani 7 years ago · 0 replies · 567 views
7 years ago

Hello,

I need to add a modal on a image when we clic on it, in a plugin.

I look at this : https://learn.getgrav.org/15/themes/asset-manager
And I tried this example : https://sabe.io/tutorials/how-to-create-modal-popup-box
I add a custom CSS, HTML and JS in a file add in the JS directory of the theme, like this
{% do assets.addJs('theme://js/modal.js', {'priority':102, 'pipeline':false, 'loading':'async', 'group':'bottom'}) %}

I have the button for the modal, but no modal when I clic on it, and no error message.

What's wrong with this ? Do I put JS in the wrong directory ?

Thanks in advance,
andre_ani

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 10 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago