pheromix pheromix - 5 months ago 20
jQuery Question

How to make the close button of Fancybox invisible?

I do not want the user to be able to close the fancybox by clicking the default close button at the upper right corner :

enter image description here

$("a#ExporterSujetReponse", context).fancybox({
'onStart': function () {

loadDeverouillerSujetAvecReponse (this) ;

},
'overlayOpacity':0.4,
'overlayColor':'#000000',
'titleShow':false,
'hideOnOverlayClick':false,
'centerOnScroll':true,
'onComplete' : function(){
$.fancybox.resize();
$('#fancybox-content').removeAttr('style').css({ 'height' : $(window).height()-100, 'margin' : '0 auto', 'width' : $(window).width()-150 });
}
});


So how to make the default close button invisible ?

Answer

Use 'showCloseButton':false

$("a#ExporterSujetReponse", context).fancybox({
  ...
  'showCloseButton':false, // add this line to hide close button
  ....
});
Comments