How to avoid unloading(close) of modal box when click outside the modal area?

2 replies · opened Nov 11, 2020

EEchionltdNov 11, 2020

Hi,

Can you please help me to avoid modal unloading(close) if I;ve click outside of the modal box?

Like if you click on certain area then the modal box will close. However, I don't want modal box get close even if I click on certain places on the webpage.

Thanks

SSemicolon WebSTAFFNov 12, 2020

Hello,

This is Definitely Possible!

Simply open the js/plugins.lightbox.js File and find the following code:
[ch_pre]element.magnificPopup({[/ch_pre]

then add the following code just after the above line:
[ch_pre]closeOnBgClick: false,[/ch_pre]

Additionally, also find the following code:
[ch_pre]$.magnificPopup.open({[/ch_pre]

then add the following code just after the above line:
[ch_pre]closeOnBgClick: false,[/ch_pre]

This will disable closing the Modal on Background Clicks. Hope this Helps!

If you are using the js/plugins.js or the js/plugins.min.js File, you will need to Update the above codes in these Files as well.

Let us know if we can help you with anything else or if you find any further issues.

EEchionltdNov 12, 2020

Thank you so much and it's working absolutely fine.:)

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard