好吧,所以我使用 .appendTo 来解决溢出问题:隐藏,因此我的整个工具提示将显示在包含的 div 之外。但是,它会在项目悬停后将工具提示锁定到位。如何清除 .appendTo 以隐藏工具提示。
$(this).hover(function(){
var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
$(this).children('.browse-tip').css({top: -40, left: pos.left - pos.width / 2});
$(this).children('.browse-tip').show();
$(this).children('.browse-tip').appendTo('#browse_wrap');
},function() {
$(this).children('.browse-tip').hide();
});