Tom Gullen
Tom Gullen

Reputation: 61773

Jquery popup tooltip

I'm using:

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

You are meant to have this in the document ready:

    $('.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'
    });

You have to explicitly set the text of the mouse over... is it possible to set the text to the elements alt atribute? Or even better, a custom attribute on the element? Something like:

innerHtml: this.attr("alt"),   

But this doesn't work as 'this' isn't defined

Upvotes: 2

Views: 1905

Answers (1)

Patrick Fisher
Patrick Fisher

Reputation: 8063

In the document ready function:

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

Upvotes: 3

Related Questions