【问题标题】:Drupal Webform item description showing nicely?Drupal Webform 项目描述显示得很好?
【发布时间】:2013-02-05 22:52:23
【问题描述】:

drupal 网站上,我有一个 webformtable-like sorted inputs。很难很好地显示长描述。有什么建议吗?

【问题讨论】:

    标签: jquery drupal drupal-webform


    【解决方案1】:

    这是我为将折叠的描述附加到标签上所做的(添加为 node 描述):

    <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>
    

    这里的沙盒:http://jsfiddle.net/eapo/3ubec/

    还有其他建议吗?

    【讨论】:

    • 如果你使用的是 drupal 7,你应该使用 drupal 行为而不是 document.ready
    • 谢谢,它在这个案例中是drupal 6。
    猜你喜欢
    • 2016-08-26
    • 2021-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-27
    相关资源
    最近更新 更多