jQuery tooltip append content in bottom of the page

老子叫甜甜 提交于 2019-12-11 03:27:12

问题


I am using a jQuery tooltip. The tooltip appears in the correct place; It appears and disappears in the correct moment. Everything seems to work correctly.. BUT When the toltip appear, the content appear ALSO in tne bottom of the page and it does not disappear anymore. Here my code:

$(document).ready(function () {
    $(document).tooltip({
        items: "#img_help_easypay",
        show: {
            effect: "slideDown",
            delay: 250
        },
        content: function () {
            return "<span>Title</span><br />" +
                   "<p>" +
                   "   <span>bla bla bla</span><br />" +
                   "   <span>bla bla bla.</span>" +
                   "</p>"
        }
    });
});

Where img_help_easypay is

<img id="img_help_easypay" src="/Styles/img/info.png" alt="aiuto easypay" style="vertical-align:top" />

Non js error... Can anyone help me? Thank you..

EDIT: In bottom of page the div has role="log"


回答1:


According to this ticket from the jQuery UI bugs platform, this is a feature started in jQuery UI 1.11.0 to increase accessibility : http://bugs.jqueryui.com/ticket/10689

If you want to entirely remove the appended <div> from your code, you have to destroy the tooltip :

$(document).tooltip( "destroy" );



回答2:


This is an accessibility "feature". I just hide the created divs:

 .ui-helper-hidden-accessible {
    display:none;
}


来源:https://stackoverflow.com/questions/25949891/jquery-tooltip-append-content-in-bottom-of-the-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!