8th November, 08:41
Hey, Craig and other qTip devs.
I followed the example of the qTip 2 "AJAX" demo, referred here.
http://craigsworks.com/projects/qtip2/demos/#ajax
What I'm trying to achieve is to select content from the data. Nothing wrong with the code, except that when I click on the link it loads the whole site in the qTip, with all the headers and sidebars and what not. Since I don't have "text-version" output of the site as a possibility.
So my question is, is there a possibility to "select" with qTip, heres a little something in plain jQuery, that I just can't make my mind about to implement
The part of div.content p is what I'd like to wrap in my data with qTip, could you provide an example please
I'm using qTip 2 on my site with the following code
Thanks :3
I followed the example of the qTip 2 "AJAX" demo, referred here.
http://craigsworks.com/projects/qtip2/demos/#ajax
What I'm trying to achieve is to select content from the data. Nothing wrong with the code, except that when I click on the link it loads the whole site in the qTip, with all the headers and sidebars and what not. Since I don't have "text-version" output of the site as a possibility.
So my question is, is there a possibility to "select" with qTip, heres a little something in plain jQuery, that I just can't make my mind about to implement
JS Code
jQuery.get(url, function(data) {
var fullContent = jQuery("article# div.content p", data);
var html = fullContent.html();
The part of div.content p is what I'd like to wrap in my data with qTip, could you provide an example please
I'm using qTip 2 on my site with the following code
JS Code
// Create the tooltips only on document load
jQuery(document).ready(function()
{
jQuery('.field-name-field-faq a').each(function()
{
// We make use of the .each() loop to gain access to each element via the "this" keyword...
jQuery(this).qtip(
{
content: {
// Set the text to an image HTML string with the correct src URL to the loading image you want to use
text: '<img class="throbber" src="/projects/qtip/images/throbber.gif" alt="Loading..." />',
ajax: {
url: jQuery(this).attr('href') // usin href here to get the a.
},
title: {
text: jQuery(this).text(), // Give the tooltip a title using each elements text
button: true
}
},
position: {
at: 'bottom center', // Position the tooltip above the link
my: 'top center',
viewport: jQuery(window), // Keep the tooltip on-screen at all times
effect: false // Disable positioning animation
},
show: {
event: 'click',
solo: true // Only show one tooltip at a time
},
hide: 'unfocus',
style: {
classes: 'ui-tooltip-wiki ui-tooltip-light ui-tooltip-shadow'
}
})
})
// Make sure it doesn't follow the link when we click it
.click(function(event) { event.preventDefault(); });
});
Thanks :3
