Smooth scroll & Modal

Hi! I am using Motion.Page animations, which messed up anchor links from external pages for some reason. I found a code, which needs Smooth-scrolling to be active, and the ScrollTo plugin. Anyways, it worked great, but now when I try to make a modal none of it’s functions are working. It opens on the click action I set it to, but from there I can’t make the overlay show, close on overlay, close on Esc and disable page scroll aren’t working either. Even clicking the button I put in the modal to close it doesn’t work (but normal menu links do). As soon as I disable Smooth-scrolling everything works perfectly, but that way anchor links don’t. Tbh I have no idea how javascript works, so making that code work was straight luck in itself, and I don’t know where to go from this.
Thank you for the help :slight_smile:

Képernyőkép 2023-08-25 152303
The exact opposite settings of how I thought it should be made everything work. I placed the Modal div inside #wrapper-content, and unchecked “Move fixed elements outside the wrapper” setting in I won’t even try to understand, but I hope this will help others :slight_smile:

Hello @razin,

Sorry for not responding earlier to this, so glad to see that you have this working.

I’m not quite familiar with Motion.Page, but we do move Cwicly modals ourselves on page load, which might have been the issue here when Motion.Page tried moving the elements.

If you have an accessible demo of this and would like me to take a look, please don’t hesitate.


1 Like