Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 that is not fast enough. I want it NOT rendered out instead of rendered then hide.

like image 968
HP. Avatar asked Nov 16 '09 02:11

HP.


People also ask

How do I close fancybox?

Try this: parent. $. fancybox. close();

How do I close a fancybox after submitting?

You can close it with $. fancybox. close() .

How do I open Fancybox on button click?

jQuery(document). ready(function($) { $('button'). on('click', function() { $. fancybox(); }); });


2 Answers

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

like image 151
Yogesh Agarwal Avatar answered Oct 21 '22 14:10

Yogesh Agarwal


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

like image 28
Quintin Robinson Avatar answered Oct 21 '22 15:10

Quintin Robinson