Streaming live at 10am (PST)

Close pop up with native back button


#1

Hello, I have created a few pop up modals for some pictures on the mobile version of my site. I have used the interaction and show and hide features on webflow. Once the user clicks on the picture, a pop up appears. The only way for the user to close the pop up, is to click the back arrow at the top of the screen I have placed.

Question: Is there a way for the user to press the back button on their browser or mobile phone (android), and have the pop up close? This way they can either use the button I have created, or the back buttons they are already used to?

Thanks in advance!


Here is my site Read-Only: LINK
(how to share your site Read-Only link)


#2

This would require some custom code, but this would get you started:

<script>
$('.example-image-class').click(function() {
    window.location.hash='example-hash-added-to-URL'
});
</script>

You could also search on Google for adding URL hash on click


#3

Thank you for the quick response. Where do I paste this?


#4

Sorry. This code won’t work as is. It’s just the general concept to get you started.


#5

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.