Tuesday, 10 September 2013

PHP breaks fancybox

PHP breaks fancybox

I'm trying to load a php file via ajax in my fancybox script. overlay.php
works fine outside fancybox and also works if I only use html in the file.
As soon as I add a simple PHP script, I get the error 'The requested
content cannot be loaded. Please try again later.'
Fancybox is loading on page load. This is the link I'm using to activate it.
Any ideas how to fix this?
Thanks
function openFancy(){
setTimeout( function() {$('.overlay').trigger('click'); },0);
}
function dontShow(){
$.fancybox.close();
$.cookie('visited', 'yes', { expires: 30 });
}
$(document).ready(function() {
var visited = $.cookie('visited');
if (visited == 'yes') {
return false;
} else {
openFancy();
}
$('.overlay').fancybox({
scrolling : 'no',
width : '100%',
fitToView : true,
closeBtn : false,
padding : 0,
margin : 20,
locked : false,
scrollOutside : false,
closeClick : false,
ajax : { type : "POST" },
helpers : { overlay : {
closeClick: false,
locked: true},
},
});
});

No comments:

Post a Comment