Skip to content Skip to sidebar Skip to footer

Hide The Close "x" Button In Fancybox

I am using this http://fancybox.net/ Is there a way to add a property to not show the close 'X' button on top right? I mean I can use 'callbackOnShow' to hide it in a hide() but th

Solution 1:

Looks like showCloseButton doesn't work any more. After looking into the fancybox code i figured out closeBtn should be set to false.

So in order to hide close button one should add below line in options -

'closeBtn' : false

Solution 2:

If you take a look at the documentation at http://fancybox.net/api it cites an option of showCloseButton that should do the trick.

From the site:

showCloseButton - Option to show/hide close button

Solution 3:

In fancybox 3 use 'modal' e.g.

$.fancybox.open({...opts: {
                modal:true,
            }
        });

Solution 4:

For those who are looking for disable it completely in fancybox v3, here it is:

smallBtn:false,
toolbar:false

Solution 5:

use boolean in 'showCloseButton' attribute. e.g

$('.editGnBtn').fancybox({
   'href': "#editGn",
   'showCloseButton':false
 });

Post a Comment for "Hide The Close "x" Button In Fancybox"