jQuery tooltip append content in bottom of the pag

2019-07-20 01:23发布

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"

2条回答
做个烂人
2楼-- · 2019-07-20 01:33

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

 .ui-helper-hidden-accessible {
    display:none;
}
查看更多
Melony?
3楼-- · 2019-07-20 01:34

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" );
查看更多
登录 后发表回答