Hide the close “X” button in Fancybox

前端 未结 6 722
独厮守ぢ
独厮守ぢ 2021-02-07 06:20

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

相关标签:
6条回答
  • 2021-02-07 06:59

    use boolean in 'showCloseButton' attribute. e.g

    $('.editGnBtn').fancybox({
       'href': "#editGn",
       'showCloseButton':false
     });
    
    0 讨论(0)
  • 2021-02-07 07:01

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

    smallBtn: false,
    toolbar: false
    
    0 讨论(0)
  • 2021-02-07 07:03

    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

    0 讨论(0)
  • 2021-02-07 07:08

    You can add the following in ... .fancybox-close {display:none; }

    But it is advisable only if the same fancybox is a popup which will automatically disappear after some time (using $.fancybox.close();)

    0 讨论(0)
  • 2021-02-07 07:14

    In fancybox 3 use 'modal' e.g.

            $.fancybox.open({
                ...
                opts: {
                    modal: true,
                }
            });
    
    0 讨论(0)
  • 2021-02-07 07:17

    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

    0 讨论(0)
提交回复
热议问题