Refresh qtip content

qtip2 is very handy to show/hide additional information on websites. The qtip content is by default cached to minimize unnecessary fetching. However though, sometimes it’s desirable to fetch for new content every time the tooltip comes up. In that case, use the once : false attribute to force re-fetching of new content.

$('#my_dom_element').qtip({
	content: {
		text: 'loading...',
		ajax: {
			url: 'my_content.php',
			once: false  // need to re-fetch every time
		},
		title: {
			text: 'My title',
			button: true
		}
	},
	position: {
		at: 'left center', // Position the tooltip above the link
		my: 'right bottom',
		viewport: $(window), // Keep the tooltip on-screen at all times
		effect: false // Disable positioning animation
	},
	show: {
		event: 'mouseenter',
		solo: true // Only show one tooltip at a time
	},
	hide: 'unfocus',
	style: {
		classes: 'ui-tooltip-wiki ui-tooltip-light ui-tooltip-shadow',
		width: '800px'
	}
});

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s