简体   繁体   中英

Tooltip not displaying right

When I try putting a tooltip on a glyphicon, it does not seem to work correctly. But when I put it outside the tile it works fine. I'm very confused and any help would be much appreciated!!

Here's the jsfiddle of what i am talking about: https://jsfiddle.net/noe3mdvx/

HTML:

<div class="col-sm-9" style="display:inline-block">
</div>
<div class="row">
    <div class="panel panel-default col-xs-2 lp-centerNav-panel" style="position: relative;" >
        <div class="tipText">
            <p>
                <span data-toggle="tooltip" title="Hooray!" class="glyphicon glyphicon-question-sign">
                </span>
            </p>
        </div>
        <div class="panel-body">
            <strong>Accounting</strong>
        </div>
     </div>
 </div>
</div>

Full HTML:

            <div class="row">
            <div class="panel panel-default col-xs-2 lp-centerNav-panel" data-ng-repeat="menuItem in lp.MenuItems" data-ng-click="lp.Redirect(menuItem);" style="position: relative;">
                <div class="tipText">
                    <span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="top" title="Hooray!"></span>
                </div>
                <div class="panel-body">
                    <strong data-ng-bind="menuItem.LinkText"></strong>
                    <img data-ng-src="{{menuItem.ImageUrl}}" />
                </div>
            </div>
        </div>

JS:

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

In your JSFiddle https://jsfiddle.net/noe3mdvx/ I found there is no js code is written and not select jQuery for your code

try to add js code

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

and select any jQuery version

May it helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM