1

你好,

这是脚本的样子 lile :

$(document).ready(function () {
    $('#MyDiv').qtip({
        content: 'I\'m at the top right of my target',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        }
    });
});    

这就是 html 的样子:

<div id="MyDiv">This is my Text</div>

没有 css 绑定到 MyDiv 元素。div 元素放置在 Begin 表单标签内。

问题是工具提示会出现在右边很远(甚至不在 div 附近)?

文档表明这应该可以工作,为什么不呢?

最好的祝福

4

1 回答 1

1

您需要为 MyDiv 元素指定 CSS 宽度。Qtip 将工具提示放在此 div 的右上角,并且 div 沿宽度方向扩展以填充它包含的元素。

使用 Firebug(使用 Firefox)或开发人员工具(使用 Internet Explorer)查看元素的尺寸,您应该会看到这一点。

于 2011-02-06T20:50:35.130 回答