user1973285
user1973285

Reputation:

Fancybox close button does not show

I'm opening a partial view with fancybox 2.1.4 but I cant get the closing cross to show. Does anyone know what I am doing wrong ?

The box with the content does show:

 function LaunchFancyBox(code) {
    jQuery.fancybox({
        'modal': true,
        'closeBtn': true,
        'content': code
    });
}

$('.sendSms').click(function () {
    $.ajax({
        url: '@Url.Action("Index", "Sms")',
        success: function (partial) {
            LaunchFancyBox(partial);
        },
    });
    return false;
});

Upvotes: 1

Views: 25192

Answers (3)

Trevor Gowing
Trevor Gowing

Reputation: 2296

From the the documentation:

modal If set to true, will disable navigation and closing
Boolean; Default value: false

Do not set the modal parameter to true

Upvotes: 7

Md Rahman
Md Rahman

Reputation: 1820

closeBtn: 'true',
afterShow: function () {
   $('.fancybox-close').attr('id', 'fancybox-close');
}

css

#fancybox-close {
display:inline !important;
top: -7px !important;
right: 1px !important;
width: 28px !important;
height: 30px !important;

}

And add "fancybox.png" to the same directory of "jquery.fancybox-1.3.4.css"

Download From Here http://www.imagemagick.org/fancybox/fancybox.png

Upvotes: 1

Jizbo Jonez
Jizbo Jonez

Reputation: 1290

The code you are using looks correct. Make sure you have uploaded the fancybox_sprite.png to wherever you have the main fancybox javascript and css files located, ie. in same folder.

Upvotes: -2

Related Questions