.tooltip() is not a function

后端 未结 3 1107
失恋的感觉
失恋的感觉 2020-12-18 17:44

I am trying to use the .tooltip() that I found from the following: Jquery-ui tooltip. What I have is a rails app that has some information in a table. In separate cells. Cur

相关标签:
3条回答
  • 2020-12-18 18:12

    I got rid of the error by adding the boostrap libs & css

    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
    
    <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    
    0 讨论(0)
  • 2020-12-18 18:31

    Try doing something like this. For tooltip to work, you will require title set for the control.

    HTML

    <td id="bookingTd" title="This is a tooltip." 
         class="<%= booking.status %>" 
         onclick='$("#booking<%= booking.id %>").dialog()'>
    
    </td>
    

    JavaScript

    $(document).ready(function(){
       $("#bookingTd").tooltip();
    });
    

    Also make sure you load jQuery first and then the tooltip plugin.

    Hope this helps you.

    0 讨论(0)
  • 2020-12-18 18:37

    In case you are using Bootstrap 4, use .min.js jquery file in place of .slim.min.js file:

    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
    
    0 讨论(0)
提交回复
热议问题