Reputation:
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
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
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
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