解决poshytip 表单高度大于屏幕高端 显示问题

Poshy Tip是一款非常友好的信息提示工具,它基于jQuery,当鼠标滑向链接时,会出现一个信息提示条。信息的内容直接可以在HTML里设定也可以是从服务端调用的数据,该插件还提供了很多属性和方法。

Poshy Tip  网上很多例子。

有些时候  由于表单高度大于屏幕高度。。就会显示不正确。

看了下源代码

在327行

var pos = {l: 0, t: 0, arrow: ''},
$win = $(window),

win = {
l: $win.scrollLeft(),
t: $win.scrollTop(),
w: $win.width(),
h: $win.height()
}, xL, xC, xR, yT, yC, yB;

这里看出t

Poshy Tip 给显示高度赋值在255行左右,

修改255行

this.$tip.css({ left: this.pos.l, top: this.pos.t });

现在稍微修改如下

if (this.opts.alignTo == 'cursor') {
this.$tip.css({ left: this.pos.l, top: this.pos.t });
}
else {        //this.opts.alignTo == 'target'
var elmOffset = this.$elm.offset();
this.$tip.css({ left: this.pos.l, top: elmOffset.top });
}

 

posted @ 2016-04-05 09:14  风从指尖飘过  阅读(188)  评论(0编辑  收藏  举报