Fancybox 3: how to show the small close button for modal iframe?

Refresh

April 2019

Views

2.1k time

1

I am using Fancybox 3 to display a modal iframe. Here is my code to initialize Fancybox:

    modal: true,
    smallBtn: true,
    iframe: {
        css: {
            width : '900px',
            height: '600px'
        },
        preload: false 
    }

If I remove modal: true, I am able to see the small button. However the small button does not show up if I set modal: true.

1 answers

1

From the docs about modal option:

// Shortcut to make content "modal" - disable keyboard navigtion, hide buttons, etc
modal : false

So, if you set it to true, there is no button displayed as expected.

Some demo demonstrating small close button - https://codepen.io/anon/pen/jaVyYV?editors=1010