Advertisement
Guest User

categorymessage.tpl

a guest
Jan 23rd, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.86 KB | None | 0 0
  1.     <div id="textBox" style="display: none; background: #ffffff; padding: 0px; border: 10px solid #fffffff; float: left; font-size: 1.2em; position: fixed; top: 50%; left: 50%; z-index: 99999; -webkit-box-shadow: 0px 0px 20px #000000; -moz-box-shadow: 0px 0px 20px  #000000; box-shadow: 0px 0px 20px #000000; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px;">
  2.         {$descriptionBox}
  3.     </div>
  4.  
  5.  
  6.     <script type="text/javascript">
  7.         {literal}
  8.  
  9.         $(document).ready(function() {
  10.  
  11.             // taille de la box et id du div à afficher
  12.             var popWidth    = {/literal}{$widthBox}{literal};
  13.             var popID   = 'textBox'
  14.  
  15.  
  16.             // faire apparaitre la fenetre modale et ajouter le bouton de fermeture
  17.             $('#' + popID).fadeIn().css({'width': Number(popWidth)}).prepend('<a href="#" class="close"><img style="float: right; margin: -20px -20px 0 0;" src="{/literal}{$base_dir}{literal}modules/categorymessage/images/close.png" class="btn_close" title="Close Window" alt="Close" /></a>');
  18.  
  19.  
  20.             // calcul la position de la fenetre
  21.             var popMargTop  = ($('#' + popID).height() + 40) / 2;
  22.             var popMargLeft = ($('#' + popID).width()  + 40) / 2;
  23.  
  24.  
  25.             // centre la fenetre
  26.             $('#' + popID).css({
  27.                 'margin-top'  : -popMargTop,
  28.                 'margin-left' : -popMargLeft
  29.             });
  30.  
  31.  
  32.             // ajoute le masque de fond
  33.             $('body').append('<div id="fade" style="display: none; background: {/literal}#{$colorBackground}{literal}; position: fixed; left: 0; top: 0; width: 100%; height: 100%; opacity: {/literal}{$opaciteBackground/100}{literal}; z-index: 9999;"></div>');
  34.             $('#fade').css({'filter' : 'alpha(opacity={/literal}{$opaciteBackground}{literal})'}).fadeIn();
  35.  
  36.  
  37.             // fermeture de la fenetre
  38.             $('a.close, #fade').click(function() {
  39.                 $('#fade , #textBox').fadeOut(function() {
  40.                     $('#fade, a.close').remove();
  41.                 });
  42.  
  43.                 return false;
  44.             })
  45.         });
  46.         {/literal}
  47.     </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement