开发者

qTip with jQuery dialogs

I'm using qTip to show validation errors in a grid. The tooltip appears after a failed row save and doesn't disappear until the row is resaved or the changes are canceled.

The problem with this is that opening a dialog while the tooltip is visible causes the tooltip to be rendered on top of the dialog. Th开发者_如何学运维at is because the z-index is hard-coded to 6000+ for all tooltips, while jQuery dialogs are set to 1000+.

I could fix this problem by changing the hard-coded value in qTip to <1000, but then tooltips fired from the dialog will appear behind the dialog.

Is there anything I can do, aside from changing the qTip code or using a different tooltip library?


Completely untested, but you might be able to put something together like this:

  • Hack the base qTip z-index so the tips will appear below the jQuery dialogs.
  • Use the qTip onRender callback to selectively raise the z-index of tips triggered only from within those dialogs so they are above the 1000 range.

As a side note, it looks like the current version of qTip actually uses 15000 as its base z-index.


Why not make the dialog's z-index 6500, and then give all qTips fired from the dialog a z-index of 7000?

Edit: Oh, you still can't set qTip's z-index on a per-tooltip basis. Rats. Perhaps hide all the existing tooltips when the dialog is shown, and re-show them when it closes?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜