Jquery弹出工具提示

时间:2011-03-09 22:04:00

标签: javascript jquery popup

我正在使用:

jQuery Bubble Popup v.2.3.1
http://maxvergelli.wordpress.com/jquery-bubble-popup/

您打算在文档中准备好这个:

    $('.bubble').CreateBubblePopup({
        align: 'center',
        innerHtml: 'TEXT GOETH HERE!',           // THIS IS THE LINE
        innerHtmlStyle: {
            color: '#FFFFFF',
            'text-align': 'center'
        },
        themeName: 'all-black',
        themePath: 'plugins/bubble/themes'
    });

您必须明确设置鼠标的文本...是否可以将文本设置为元素alt属性?或者甚至更好,元素的自定义属性?类似的东西:

innerHtml: this.attr("alt"),   

但这不起作用,因为'this'未定义

1 个答案:

答案 0 :(得分:3)

在文件就绪功能中:

$('.bubble').each(function(){
    $(this).CreateBubblePopup({
        align: 'center',
        innerHtml: $(this).attr('mouseoverText'),
        innerHtmlStyle: {
            color: '#FFFFFF',
            'text-align': 'center'
        },
        themeName: 'all-black',
        themePath: 'plugins/bubble/themes'
    });
});
相关问题