简体   繁体   English

jQuery工具提示-当用户开始在文本框中输入内容时,如何关闭工具提示?

[英]jQuery Tooltip - How do you close the tooltip when a user starts typing in the textbox?

I have a tooltip associated with some textboxes as follows: 我有一个与一些文本框关联的工具提示,如下所示:

$(document).tooltip({
    items: "[data-my-latitude]",
    position: {
        my: "center bottom-15",
        at: "center top",
        using: function( position, feedback ) {
            $( this ).css( position );
            $( "" )
                .addClass( "arrow" )
                .addClass( feedback.vertical )
                .addClass( feedback.horizontal )
                .appendTo( this );
        }
    },
    content: function() {
        var element = $( this );
        if ( element.is( "[data-my-latitude]" ) ) {

            if (element.prop('disabled'))
                return null;

            return _map.build(element.val());
        }
        return null;
    }
});

Everything works fine, but I will like to close the close the tooltip window if the user types a different value into the textbox. 一切正常,但如果用户在文本框中键入其他值,我想关闭工具提示窗口。

If anyone is interested, I ended up doing this: 如果有人感兴趣,我最终会这样做:

element.keyup( function () {
    $(".ui-tooltip-content").parents('div').remove();
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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