Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. //el PHP
  2.  
  3. function selector_reductores_add_markup(&$form_element, $active=true, $tooltip=false, $tooltip_id=null, $tooltip_contents=null)
  4. {
  5.   if($active)
  6.   {
  7.     $form_element['#prefix'] = '<div class="active field-wrapper expanded">';
  8.     $form_element['#suffix'] = '</div>';
  9.   }
  10.   else
  11.   {
  12.     $form_element['#prefix'] = '<div class="inactive field-wrapper colapsed">';
  13.     $form_element['#suffix'] = '</div>';
  14.   }
  15.   if($tooltip&&!empty($tooltip_id))
  16.   {
  17.     $tooltip_id=str_replace('_', '-', $tooltip_id);
  18.     $tooltip_id=str_replace(' ', '-', $tooltip_id);
  19.     $tooltip_id=str_replace(':', '-', $tooltip_id);
  20.     $form_element['#suffix']="<span id='$tooltip_id'>$tooltip_contents</span>".$form_element['#suffix'];
  21.   }
  22. }
  23.  
  24. //el CSS
  25. .field-wrapper span{
  26.     visibility: hidden;
  27.     position: absolute;
  28.     top: 2.3em;
  29.     z-index: 100;
  30.     -ms-border-radius: 5px;
  31.     -webkit-border-radius: 5px;
  32.     -moz-border-radius: 5px;
  33.     -khtml-border-radius: 5px;
  34.     border-radius: 5px;
  35. }
  36.  
  37. .field-wrapper{
  38.     position:relative;
  39. }
  40.  
  41. .active.field-wrapper:hover span{
  42.     display:block;
  43.     visibility: visible;
  44. }
  45.  
  46. //y luego via ID le pones el tamaño que le toca a cada uno, la imagen de fondo, etc etc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement