Frage

On a drupal site I have a webform with table-like sorted inputs. Its hard to display long descriptions nicely. Any suggestions?

War es hilfreich?

Lösung

This is what I made to attach descriptions collapsed to labels (added as node description):

<script type="text/javascript">
    $(document).ready(function(){   
        $(".form-item:has(div.description)").children("label").append(function(){
            $(this).parent().children('.description').hide();
            return '<sup><a href="#" onclick="$(this).parent().parent().parent().find(\'.description\').toggle();" title="'+$(this).parent().children('.description').text()+'"><strong>?</strong></a></sup>';
        }); 
    });
</script>

Sandbox here: http://jsfiddle.net/eapo/3ubec/

Any other suggestions?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top