For the past few months, I've been struggling with an issue. My goal is to launch a fancybox as soon as the page loads. The fancybox is supposed to display AJAX data.
Despite having functional code, there's a recurring problem where the overlay covers up the content. Upon inspecting the HTML, I noticed that the content gets trapped inside the overlay instead of being placed outside it as a separate element.
I've scoured the internet for solutions but haven't been able to resolve this anomaly. This glitch only seems to happen when loading AJAX data into the fancybox via code, without using a hyperlink. Even attempting to simulate a click event by using a hyperlink and triggering .click() has proven futile.
@if(deniedUsersListCnt > 0){
<script>
$(document).ready(function () {
fancyBoxAjaxGet("/UsersAdmin/_ShowListOfDeniedUsers");
});
</script>
}
function fancyboxAjaxGet(dUrl){
$.fancybox.open({
href: dUrl,
type: "ajax",
ajax: {
type: "GET"
}
});
}
The versions I'm working with are fancybox 2.1.5 and JQuery 2.1.1.