Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //el PHP
- function selector_reductores_add_markup(&$form_element, $active=true, $tooltip=false, $tooltip_id=null, $tooltip_contents=null)
- {
- if($active)
- {
- $form_element['#prefix'] = '<div class="active field-wrapper expanded">';
- $form_element['#suffix'] = '</div>';
- }
- else
- {
- $form_element['#prefix'] = '<div class="inactive field-wrapper colapsed">';
- $form_element['#suffix'] = '</div>';
- }
- if($tooltip&&!empty($tooltip_id))
- {
- $tooltip_id=str_replace('_', '-', $tooltip_id);
- $tooltip_id=str_replace(' ', '-', $tooltip_id);
- $tooltip_id=str_replace(':', '-', $tooltip_id);
- $form_element['#suffix']="<span id='$tooltip_id'>$tooltip_contents</span>".$form_element['#suffix'];
- }
- }
- //el CSS
- .field-wrapper span{
- visibility: hidden;
- position: absolute;
- top: 2.3em;
- z-index: 100;
- -ms-border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- border-radius: 5px;
- }
- .field-wrapper{
- position:relative;
- }
- .active.field-wrapper:hover span{
- display:block;
- visibility: visible;
- }
- //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