TEXT   30
poplayer
Guest on 6th February 2023 02:24:41 AM


  1. function layer_open(layer_id, pop_id){
  2.         var temp = $('#' + layer_id);
  3.         var bg = temp.prev().hasClass('bg');
  4.  
  5.         if(bg){
  6.                 $( '#' + pop_id).fadeIn();     
  7.         }else{
  8.                 temp.fadeIn();
  9.         }
  10.  
  11.         //if (temp.outerHeight() < $(document).height() ) temp.css('margin-top', '-'+temp.outerHeight()/2+'px');
  12.         //else temp.css('top', '0px');
  13.         //if (temp.outerWidth() < $(document).width() ) temp.css('margin-left', '-'+temp.outerWidth()/2+'px');
  14.         //else temp.css('left', '0px');
  15.  
  16.         temp.find('a.cbtn').click(function(e){
  17.                 if(bg){
  18.                         $('#' + pop_id).fadeOut();
  19.                 }else{
  20.                         temp.fadeOut();
  21.                 }
  22.                 e.preventDefault();
  23.         });
  24.  
  25.         $('#' + pop_id + ' .bg').click(function(e){    
  26.                 $('#' + pop_id).fadeOut();
  27.                 e.preventDefault();
  28.         });
  29.  
  30.  
  31.  
  32. }

Raw Paste

Login or Register to edit or fork this paste. It's free.