Issue with closing inline modal

6 replies · opened Jul 25, 2016

SSemicolon WebSTAFFJul 25, 2016

Hello,

This is because the Modal Content is set to 100% Width by default by the Plugin. It is recommended to use this by default since the Modal Content and Width can vary and Custom Width Styling for so many different modals is not supported at the moment.

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

CcadilhacJul 27, 2016

ok, so why doesn't it occur also for other modals like html5 video or map embed?

SSemicolon WebSTAFFJul 28, 2016

Hello,

Actually, iFrame Modals have been set at max-width of 900px which is why they can be clicked on the Left/Right to get closed. However, Inline Modals have been set at 100%.

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

Kkatoba86Sep 16, 2016

Hi cadilhac,
I had the same problem. Solevd it by using the following function. Hope it helps:


$.magnificPopup.open({
            items: { src: elementTarget },
            type: 'inline',
            mainClass: 'mfp-no-margins mfp-fade',
            closeBtnInside: false,
            closeOnBgClick: true,
            fixedContentPos: true,
            removalDelay: 500,
            callbacks: {
                open: function(){
                    $('.mfp-content').css('left',$(document).width()/2-$('.mfp-content').width()/2);
                    if( elementAnimateIn != '' ) {
                        $(elementTarget).addClass( elementAnimateIn + ' animated' );
                    }
                },
                //default theme callbacks removed.. if you need it, copy them here
            }
        }, 0);
Kkatoba86Sep 16, 2016

Remove the width from the mfpcontainer in magnific-popup.css

remove:
.mfp-container {
text-align: center;
position: absolute;
/* width: 100%; */
height: 100%;
top: 0;
padding: 0 8px;
box-sizing: border-box; }

SSemicolon WebSTAFFSep 19, 2016

Hello @katoba86,

Thank you so much for this Amazing Helpful Tip! We are sure that this will eventually help a Lot of Users.

Do let us know if we can help you with anything or if you find any issues with Canvas. Thanks. :)

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