I have successfully created the modal window for the “conditions apply” in the top left. I am wondering if I can have multiple instances of modals on one page? I am not great at knowing the rules of js etc. I duplicated the modal with different classes, everything seems the same, but the second popup at the bottom using an image inside a link block does not work. Can someone tell me if this is possible or what I might be missing? Thanks
Hey guys I don’t think I’ve seen the answer to the question here so forgive me it was posted but does any know how to make sure that the modal only pops up once per user as opposed to every time the user visits the page? Thanks! Otherwise it works great!
I get emails from users for which modal window works only partialy. And that is because of using a button widget (<a href="#"></a>) for modal popup trigger. I would suggest changing a code a little bit here as this is the second most viewed topic and people use this solution a lot (based on only on emails I get or Skype msgs).
That simple change in code of adding e inside each function as an argument and also adding e.preventDefault(); result in the code working properly. If users were to use my first code that you have posted in first post then on each click of a button the site will automatically scroll them to the top of the website as it is refering to # by default.
Also I would suggest for those who use non-link objects as modal trigger to add the following:
I had this working perfectly then I duplicated the site. Now the modal background shows up however the modal window does not. Can anyone help me out? I have tried everything I can think of. I have it working on a this page: sharksbaseball.webflow.io/modal but it does not work on the team page for 12U Milanovich. If you click on any of the boys names, you will see my issue. Public link is here. Thanks, everyone for helping.
Hi, I’m quite new to Webflow and web design in general and trying this out for the first time but the code doesn’t seem to be working for me. When I publish and go to my site the modal button does not trigger the modal window. I have tried with the modal background display settings on block and none (when it’s in block it displays the window but then it doesn’t close).
Sweet code this! But on mobile, I couldn’t get the body to be un-scrollable when the modal is open. It only works on desktop for me. Got a solution to this @thunder ?
I haven’t needed to make any popups in a while, so not sure how my snippet works/fails on mobile. Glad it was at least partially helpful to you, though.
If quick googling doesn’t turn up likely answers for you, I’d suggest dumping the site into an editor with live reload on a mobile device, so you can quickly test different ideas, then once you find the right css/js incantation backport it to Webflow. Sounds tedious, but can be quite effective to zero-in on a solution.
I have a modal that changes height as users interact with it, and this causes the page to jump down as the height gets taller. Is there anyway to keep the page (behind the modal) locked when the modal is active?
Thanks for all the tips in here! I was wondering if you had a chance to implement the cookie functionality? I really need it for a site I’m launching next week. Thanks!
Hey guys, great tutorial (so far) but my button doesn’t open up my modal as it should. I followed the instructions and put everything in there (check it out here http://jetty.webflow.io/ the modal “test” button is on the bottom right). It seems to me that for some reason there is an “w-button” added to my classes… I didn’t put it in there… it’s all over the place though.
Any ideas how to fix this? Thank you in advance!!
Found the solution myself: don’t copy the script code into the dashboard custom code fields, rather do it in the page details in the designer!