Bootstrap tooltip does not respect data placement parameter

I added tooltip options for my element:

<input type="text" name="appbundle" data-toggle="tooltip" data-placement="top" title="My title" class="form-control">

      

I also added the following script:

$('[data-toggle="tooltip"]').tooltip();

      

Well, the tooltip is displayed, but it doesn't take into account the data placement option: it's always at the bottom of the control.

I saw there were some positioning issues, but all I found was a long time ago and now I have bootstrap 3.3.1.

Is there a clue to solving this problem?

Edit: Here is some sample code with the same librairies I'm using. Still not working

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="vendor/bootstrap-3.3.1/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="vendor/bootstrap-3.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="vendor/jquery-ui-1.11.2/jquery-ui.min.css">
    <link rel="stylesheet" href="vendor/jquery-ui-1.11.2/jquery-ui.structure.min.css">
    <link rel="stylesheet" href="vendor/jquery-ui-1.11.2/jquery-ui.theme.min.css">
</head>

<body>
    <script src="vendor/bootstrap-3.3.1/js/bootstrap.min.js"></script>
    <script src="vendor/bootstrap-3.3.1/js/npm.js"></script>
    <script src="vendor/jquery/jquery-2.1.1.min.js"></script>
    <script src="vendor/jquery-ui-1.11.2/jquery-ui.min.js"></script>

    <p>test</p>
    <br>
    <input type="text" name="appbundle" data-toggle="tooltip" data-placement="top" title="My title" class="form-control">

<script>
    $(function(){
        $('[data-toggle="tooltip"]').tooltip();
    });
</script>
</body>

      

+3


source to share


2 answers


Found it!

I was adding bootstrap js in front of the jquery ui and it caused the problem. The same was true for some other libraries.



Put the bootstrap js at the end!

+6


source


Use this jquery and bootstrap js file order



<script type="text/javascript" src="js/jquery-ui.js"></script>
<script src="js/bootstrap.min.js" ></script>
      

Run codeHide result


0


source







All Articles