【问题标题】:Adding Bootstrap tooltips into form label将引导工具提示添加到表单标签中
【发布时间】:2018-12-28 13:07:11
【问题描述】:

我试图将tooltips 变成laravelcollective

<div class="form-group col-sm-4">
  {!! Form::label('exchange_id', 'Exchanges:') !!}
  {!! Form::select('exchange_id', [''=>'Choose Options'] + $exchanges , null, ['class'=>'form-control', 'id'=>'exchange', 'name'=>'exchange_id',  'onchange' => 'all_function()'])!!}
</div>

在上面的选择框中,{!! Form::label('exchange_id', 'Exchanges:') !!} 我想输入 Bootstrap 工具提示,例如,Exchanges ?:带问号。
我该怎么做?

【问题讨论】:

    标签: html laravel twitter-bootstrap laravelcollective


    【解决方案1】:

    您可以为label标签、data-toggle="tooltip"title="Exchanges ?"添加属性

    <div class="form-group col-sm-4">
     {!! Form::label('exchange_id', 'Exchanges:', ['data-toggle' => 'tooltip', 'title' => 'Exchanges ?']) !!}
     {!! Form::select('exchange_id', ['' => 'Choose Options'] + $exchanges, null, ['class' => 'form-control', 'id' => 'exchange', 'name' => 'exchange_id', 'onchange' => 'all_function()'])!!}
    </div>
    

    需要引导插件并喜欢它使用

    $(function () {
      $('[data-toggle="tooltip"]').tooltip()
    })
    

    工具提示:http://getbootstrap.com/docs/4.1/components/tooltips/

    演示:http://jsfiddle.net/xL1vteoj/

    【讨论】:

    • 我已经添加了bootstrap plugin,但我无法理解如何在标签Exchanges:上添加工具提示。
    • 抱歉,超出了电视限制!
    • 再试一次@Jagjeet Singh
    猜你喜欢
    • 2013-03-08
    • 2015-03-22
    • 1970-01-01
    • 2014-06-30
    • 1970-01-01
    • 2014-12-17
    • 2016-03-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多