【问题标题】:Jquery tooltip plugin qTip doesn't seem to set width properlyJquery 工具提示插件 qTip 似乎没有正确设置宽度
【发布时间】:2010-05-16 00:34:06
【问题描述】:

我有一个 asp.net mvc 站点,这是一个使用 qTip 的动态工具提示

这是我的代码:

$('a.showNutritionInfo').each(function() {

    $(this).qtip({
        content: {
        text: '<img src="../../images/ajax-loader1.gif" alt="" />',
        style: { width: 450 },
        url: '/Tracker/NutritionInfo/' + $(this).attr('id'),
        method: 'get'
        }
    });
});

这很好除了上面列出的宽度属性被忽略。无论我在该宽度属性中添加什么,我都会得到相同大小的宽度工具提示,大约是我需要的宽度的一半。高度非常好。

有什么想法吗?这是产品中的错误吗?

【问题讨论】:

    标签: jquery asp.net-mvc width qtip


    【解决方案1】:

    您需要将style 声明放在content 声明之外,因为它们是两个不同的属性:

    $(this).qtip({
        content: {
            text: '<img src="../../images/ajax-loader1.gif" alt="" />',
            url: '/Tracker/NutritionInfo/' + $(this).attr('id'),
            method: 'get'
        },
        style: { width: 450 }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-09
      • 2019-10-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多