【问题标题】:how to add line break whitin popup data-tooltip in Semantic-UI如何在 Semantic-UI 的弹出数据工具提示中添加换行符
【发布时间】:2019-10-08 10:31:01
【问题描述】:

我想在 data-tooltip 中使用添加换行符总共 3 个句子 我已经尝试过了,但它不起作用

    <div class="ui icon button" data-html="true"
    data-tooltip="The default theme's basic popup <br/> 
removes the pointing arrow." 
    data-position="bottom center">
      <i class="add icon"></i>
    </div>

【问题讨论】:

    标签: javascript jquery popup tooltip semantic-ui


    【解决方案1】:

    你可以用这个:

    <div class="ui icon button" data-html="<div class='content'>The default theme's basic 
    popup <br/> removes the pointing arrow.</div></div>" data-position="bottom center">
       <i class="add icon"></i>
    </div>
    

    或者这个,在这种格式下你可以使用你需要的每一个html标签:

    <div class="ui icon button test">
        <i class="add icon"></i>
    </div>
    <div class="ui custom popup top left transition hidden">
        The default theme's basic popup 
        <br/>
        removes the pointing arrow.
    </div>
    

    并使用此脚本:

    <script>
        $(".test.button").popup({
           popup : $(".custom.popup"),
           on    : 'hover'
        });
    </script>
    

    【讨论】:

    • 谢谢,但我无法修复它。我的脚本不工作。
    • 你的脚本应该在你的 DOM 准备好之后运行。所以你这样写: $( document ).ready(function() { $(".test.button").popup({ popup : $(".custom.popup"), on : 'hover' }); });
    猜你喜欢
    • 2018-07-19
    • 2022-08-02
    • 2011-03-21
    • 1970-01-01
    • 2013-01-14
    • 2013-09-30
    • 1970-01-01
    • 2022-08-22
    • 2021-04-20
    相关资源
    最近更新 更多