generate jquery pop-up from ajax
hi
I use jquery pop-up plugin
it works perfectly on my page
but where I call this page from Ajax it doesnot works, Why?
the pop-up code
- $(document).ready(
- function(){
- //open popup
- $(document).on("click", ".pop", function(){
- var url = $(this).attr('name');
- $("#"+url).fadeIn(1000);
- positionPopup(this);
- });
- //close popup
- $(document).on("click", ".close", function(){
- var url = $(this).attr('name');
- $("#"+url).fadeOut(500);
- });
- });
- //position the popup at the center of the page
- function positionPopup(element){
- var url = $(element).attr('name');
- if(!$("#"+url).is(':visible')){
- return;
- }
- $("#"+url).css({
- left: ($(window).width() - $('#'+url).width()) / 2,
- top: ($(window).width() - $('#'+url).width()) / 7,
- position:'absolute'
- });
- }
- //maintain the popup at center of the page when browser resized
- $(window).bind('resize',positionPopup);
- </script>
- <style>
- .overlay_form{
- position: absolute;
- border: 0px solid gray;
- padding: 0px;
- background: ;
- width: 400px;
- height: 500px;
- }
- .pop{
- display: inline;
- border: 0px solid gray;
- width: 65px;
- text-align: center;
- padding: 6px;
- border-radius: 5px;
- text-decoration: none;
- margin: 0 auto;
- }
- </style>
in my page called by ajax
- <nobr><a href='#' id="pop" class="pop" name='<?='overlay_form'.$j?>' ><?=get_bc_branch_name($det['branch_id'])?></a></nobr>
- <div class="overlay_form" id='<?="overlay_form".$j?>' style="display:none">
- <?
- $_GET['b_id']=$det['branch_id'];
- include('bc_branch_profile.php');
- ?>
- </div>