mike
mike

Reputation: 8141

jquery qtip plugin

I am using the jQuery qTip plugin and am having trouble loading html content into it from another element.

I have the following code:

$('.tip').qtip({
    content: { 
        text: $(this).next('.product_info').html() 
    }
});

with the following html:

<a href="#" class="tip">An Image</a>
<div class="product_info">Some content</div>

The problem is that I cannot seem to use "$(this)" so how can I refer to the current ".tip"?

Thanks!

Upvotes: 0

Views: 231

Answers (1)

Patricia
Patricia

Reputation: 7802

i think this question's answer will answer this for you: qtip jquery plugin to display text from link

basically you need to loop through your things to tip and then tip then individually and this will work;

$('.tip').each(function(){
    $(this).qtip({
        content: { 
            text: $(this).next('.product_info').html() 
        }
     });
});

Upvotes: 1

Related Questions