Interaction: When clicked, change 'overflow' to 'visible'

Hey guys!

I’m trying to achieve the following interaction: When clicked, change ‘overflow’ to ‘visible’.

I have an element that has the property ‘overflow’ hidden. But I want it to change to ‘visible’ when I click on an element. I need custom js code for this. I’ve been looking online but can’t find the exact answer. (also, my js knowlegde is not a lot…)

Can someone help me?

Thank you!!


Here is my public share link: https://preview.webflow.com/preview/windkracht5-v2?utm_medium=preview_link&utm_source=designer&utm_content=windkracht5-v2&preview=0a2999c5ec1bd3fe943b7c3de41241dc&mode=preview

Here the link to website: https://windkracht5-v2.webflow.io/
Password: Kf^5kkX9Dk@F

Hey @Eva_Reussien, can you tell us which button is suppose to have that feature?

Otherwise, you can try something like this.

var container = $('.container');

$('.button').on('click', function(){
  
 if(container.css('overflow') == visible){
   container.css('overflow', 'hidden');
} else {
   container.css('overflow', 'visible');
}

})
1 Like

Thanks for the help!

1 Like