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


April 2019


2.1k time


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


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 -