I have a section of writing on my page, that, when passed, I want the user to get a modal popup. Is this possible? I was able to get my modal to show on scroll but I realized this wasn't responsive
Is it possible to make a modal show when an element is passed in the hmtl?
3 replies · opened Nov 30, 2021
Hello,
This will also require Custom JS Codes. You can consider using the following:
[ch_pre type="js"]window.addEventListener("scroll", function() {
var elementTarget = document.getElementById("section-2");
if (window.scrollY > (elementTarget.offsetTop + elementTarget.offsetHeight)) {
// Display modal
}
});[/ch_pre]
This should work fine. Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Thank you, will implement it when I can
Hello,
Sure. Please take your time.
Do let us know if you are facing any issues.
Have the same question, or something new?
Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.
Reply on the dashboard