Model Window not working

I am using Webflow for my project, everything is work fine, I feel 2 issues in functionality. as I want to add a modal window as per my design, I saw your videos, blogs etc and did everything according to that for modal window, you can check here: https://preview.webflow.com/preview/avpd?preview=c0653cb1921832d00015ce8340ffd85c in popup-test2 page. but it doesn’t work. can you please help me for that. same for accordion, I did everything same in interaction which I saw in video, it works here: https://preview.webflow.com/preview/avpd?preview=c0653cb1921832d00015ce8340ffd85c > treatment page > common question tab. it works but smoothly as it should be, So please help me over here I want to complete my this project ASAP.

Hi @simran21, looks like the modal is not working, because you have the script code in the Header instead of the Footer.

Could you move this code from the Header:

$(document).ready(function() {
  $('.modal-link').click(function() {
    $('.modal-background').fadeIn();
  });
  $('.close-modal').click(function() {
    $('.modal-background').fadeOut();
  });
});

and put it in the Footer section of the Custom Code tab of your site settings.

Also wrap the code with the style tags, so it will look like:

<script>
$(document).ready(function() {
  $('.modal-link').click(function() {
    $('.modal-background').fadeIn();
  });
  $('.close-modal').click(function() {
    $('.modal-background').fadeOut();
  });
});
</script>

Save changes and republish. After republishing, if it still not work, let me know and I will take another look :smile:
Cheers,
Dave

Hi @cyberdave , I did that as now I put code in footer section and recode that all popup section. but it still not working, can you check https://preview.webflow.com/preview/avpd?preview=c0653cb1921832d00015ce8340ffd85c here on popup-test2 page.

Thanks
Simran

It does work for me.

Post has to be 30 characters

@bartekkustra really Is it work for you, modal window open when you click on res “popup” button?

Yeah. Look:
http://quick.as/nRpTVAlB

Just remember that Custom Javascript is not visible within Webflow Project but only on the published website.

Ohhh yeah, That I was missing, Thanks @bartekkustra.

One more thing I use a accordion here: http://avpd.webflow.io/treatment on question and answer area. It doesn’t work smoothly, can you me help me what I am missing.