【问题标题】:Is it possible to tell qTip 2.0 to use other attribute than 'title' as default?是否可以告诉 qTip 2.0 默认使用除“title”之外的其他属性?
【发布时间】:2011-10-12 19:40:48
【问题描述】:

我如何告诉 qTip 使用除 'title' 之外的另一个属性作为默认值?

我需要使用另一个属性的原因是,当我禁用 qtip 并动态添加带有“标题”的元素时,当我将鼠标悬停在元素上时,标题将显示。我不想发生这种情况。

谢谢

【问题讨论】:

    标签: javascript jquery qtip


    【解决方案1】:

    在我们的项目中,我们还使用 qTip 并强制它使用子项的内容而不是 Title 属性。子内容默认隐藏(CSS -> display:none;)

    $('.tipped').each(function()
    {
        $elem = $(this);
        $elem .qtip({
            content: $elem.children('.tiptext').html(),
            show: 'mouseover',
            hide: 'mouseout',
            position: {
                corner: {
                    target: 'bottomMiddle',
                    tooltip: 'topMiddle'
                }
            },
            style: {
                tip: true,
                name: 'blue',
                color: '#A04242',
                background: '#EEEEEE',
                border: {
                    width: 1,
                    radius: 3,
                    color: '#4F81BD'
                }
            }
        });
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-10
      • 1970-01-01
      • 2019-09-08
      • 1970-01-01
      • 2021-05-01
      • 1970-01-01
      • 2019-06-15
      相关资源
      最近更新 更多