给jqgrid增加表头提示功能,效果如下:
功能实现增加以下代码:
<a tabindex="0" rel="popover" data-content="testtesttest"><span class="glyphicon glyphicon-info-sign"></span></a>
span标签的class:glyphicon glyphicon-info-sign。请参考BootStrap3的组件
$("[rel=popover]").popover({
trigger: "manual",
html: true,
animation: false,
container: "body",
placement: "top"
})
.on("mouseenter", function () {
var _this = this;
$(this).popover("show");
$(".popover").on("mouseleave", function () {
$(_this).popover('hide')
})
}).on("mouseleave", function () {
var _this = this;
setTimeout(function () {
if (!$(".popover:hover").length) {
$(_this).popover("hide")
}
}, 300)
})