Search code examples
jqueryasp.nethtmlcolorbox

my link button working only on load of lightbox


i m working on project in which i need open popup window on div onclick onclick="window.scrollTo(0,0);" i took iframe for link but my problem is that when i click on image then one lightbox is open with product detail which is calling by js. data is loaded with .html function.when first time page is load then i click on div then popup window is open but when i close the product detail lightbox then after i reopen the lightbox then i click on div click then popup window is not open.

function ssdd()
{
 //var myid=myid1;
  //$(document).ready(function() {       

 $('#cboxLoadedContent div').on('click','#learn',function()
    {

     $('#learn_more').AeroWindow({

                WindowTitle:          'Learn More',
                WindowPositionTop:    5,
                WindowPositionLeft:   'center',
                WindowWidth:          650,
                WindowHeight:         490,
                WindowAnimationSpeed: 1000,
                WindowAnimation:      'easeOutCubic',
                WindowResizable:      false,
                WindowDraggable:      true,
                WindowMinimize:       true,
                WindowMaximize:       false,
                WindowClosable:       true


          });
           });
        //var afd= sdp();
        return false;
   // });
 }

Solution

  • i found the solution is that we can remove the iframe containing div id learn_more on popup window close button and then below that we append the div id learn_more with iframe.it means on close we delete the iframe div and same time we create the div with iframe. like this

    BTNClose.click(function () {

        $(this).find(".AeroWindow").css('display', 'block'); 
         var sdx= $('#cboxLoadedContent div').find('div.AeroWindow ui-draggable active');
        $('#cboxLoadedContent div').find('div.AeroWindow').removeClass('.active ui-draggable');
        $('#learn_more').remove();
        $('#cboxLoadedContent div').find('div#learn').append("<div id='learn_more' style='display: none; width: 100%; height: 100%;'><iframe width='100%' height='100%' frameborder='0' scrolling='yes' marginheight='0' marginwidth='0' src='window_page-price_learn_more' align='bottom'></iframe></div>")
    
        $('.AeroWindow ui-draggable active').remove();
    
    
    
         WindowContent="";
         Window.css('display','none');
    
    
          return(false);          
        });