Reputation: 481
function LoadModal(page, title) {
title = title || '';
$( "#modal_page" ).fadeIn("slow");
$( "#modal_title" ).html(title);
$("#modal_page_body").html('<h2 align="center">Loading...</h3><p align="center"><i class="fa fa-refresh fa-spin fa-5x"></i></p>'); //$('#LoadingDiv').show();
$("#modal_page_body").load(page, function(){
});
$("html, body").animate({ scrollTop: 0 }, "slow");
}
i have the above function in JQuery and i call it with this code:
<a href="#" onClick="LoadModal('/section/helpdesk/newticket', 'New Ticket');" title="New Ticket"><i class="fa fa-ticket"></i></a>
Its working how i want it and the page is loading into the modal which is displaying fine.
However, when I close the Modal $("#modal_page").fadeOut("slow")
any JQuery code on the main index.php page is not running. For example, I have a .toggle
but that does not work. If i refresh the page, it then works fine until i open and close this modal again
Upvotes: 2
Views: 87
Reputation: 4216
I think you have called jQuery lib file in your pop up page. So it's replacing the whole jQuery. Then after its gone jQuery has nothing. So, try removing jQuery from there.
Upvotes: 1