Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help regenerating qTips!
7th September, 23:01
Post: #1
Help regenerating qTips!
Hey everyone,

I'm implementing qTips (r55 w/ jQuery 1.4) via a function call to dynamically create qTip windows as necessary through a set update interval in JavaScript. Here's some code to better visualize what I'm doing:

JS Code
function popTips(Day, Type, Comment, BubbleLocation, TipLocation) {
		if(!BubbleLocation) BubbleLocation = 'bottomLeft';
		if(!TipLocation) TipLocation = 'topRight';
		jQuery('#alertContainer' + Day + Type).mouseover(function() {
			jQuery(this).qtip({
				content: Comment,
				position: {
					corner: { tooltip: TipLocation, target: BubbleLocation }
				},
				show: { ready: true, solo: true },
				hide: { fixed: true, delay: 1500 },
				style: { 
					border: { radius: 3 },
					padding: 3, 
					textAlign: 'center', 
					tip: true
				}
			});
		});
	}
 
function initialUpdate() {
		if(initialPercentOnTrack == null) initialPercentOnTrack = mainArray["PercentOnTrack"];
 
		// Monday Stats
		if(<?= $dayNumber; ?> > 1) {
			jQuery('#mondayRevFinal').html("$" + mainArray["MondayRev"]);
			jQuery('#mondayJobsFinal').html(mainArray["MondayJobs"]);
			if(mainArray["MondayRev"] >= mainArray["MondayRevGoal"]) {
				document.getElementById("mondayRevTD").style.background = "#94e39e";
			} else {
				document.getElementById("mondayRevTD").style.background = "#ff7272";
				jQuery('#alertContainerMondayRev').html('<img src="images/alert.png" />');
				popTips('Monday', 'Rev', 'You did not meet your daily revenue goal of <b>$' + mainArray["MondayRevGoal"] + '</b>.Strive to meet this goal everday to help you towards a commission bonus!');
			}
			if(mainArray["MondayJobs"] >= mainArray["MondayJobsGoal"]) {
				jQuery("#mondayJobsTD").css("background-color","#94e39e");
			} else {
				document.getElementById("mondayJobsTD").style.background = "#ff7272";
				jQuery('#alertContainerMondayJobs').html('<img src="images/alert.png" />');
				popTips('Monday', 'Jobs', 'You did not meet your daily jobs goal of <b>' + mainArray["MondayJobsGoal"] + '</b>.Strive to meet this goal everday to help you towards a commission bonus!');
			}
		}
 
		// Flush Main Array
		mainArray = [];
}
setInterval(initialUpdate, 33000);

What I've noticed is that after about the second interval refresh, the qTip windows start loading slowly, then eventually just freeze my browser completely. I've tried adding:
JS Code
jQuery('#alertContainerMondayRev').qtip("destroy");
before each qTip function call to destroy the previously created one, I've also tried adding:
JS Code
var qtips = jQuery.fn.qtip.interfaces,
i = qtips.length; while(i--) qtips.destroy();
at the beginning of my "initialUpdate()" function to try destroying all qTip windows before they're generated again, but no luck.

I'm not sure if I'm being overly complicated with this, but it seems like one of those solutions I tried should have fixed what "I think" is broken. Someone please help! Smile
Find all posts by this user
Quote this message in a reply
8th September, 17:18
Post: #2
RE: Help regenerating qTips!
abracadabra, may I suggest you try upgrading to 2.0? 1.x releases are very resource intensive and binding/unbinding them consistantely can cause some pretty huge memory leaks!

Check-out the 2.0 forum for more on this: http://craigsworks.com/projects/forums/f...-strigidae

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
8th September, 17:40
Post: #3
RE: Help regenerating qTips!
(8th September 17:18)Craig Wrote:  abracadabra, may I suggest you try upgrading to 2.0? 1.x releases are very resource intensive and binding/unbinding them consistantely can cause some pretty huge memory leaks!

Check-out the 2.0 forum for more on this: http://craigsworks.com/projects/forums/f...-strigidae

Thanks very much, Craig! I would hate to give up the rounded corners as it suits my website design to the T, but performance is a higher priority unfortunately. Blush

Any news on qCorner?
Find all posts by this user
Quote this message in a reply
11th September, 08:42
Post: #4
RE: Help regenerating qTips!
qCorner has been discontinued in favour of standard border-radius properties unfortunately. This was mostly because of performance issues, as well as problems with cross-browser support.

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] Multiple qtips on one page, content disappearing russau 3 132 3rd May 16:38
Last Post: Craig
  Qtips with jquery UI Issue sherwoodbear79 2 448 15th February 15:36
Last Post: sherwoodbear79
  [solved] Trouble with qtips adding a scrollbar momentarily to window patricia 0 354 2nd December 19:40
Last Post: patricia
  Changing HTML Content on Click & Remove/Reinit qTips ifthatdoesntdoit 5 1,237 17th November 09:46
Last Post: ifthatdoesntdoit
  [Solved] multiple qtips and 1.4.2 - popup not being removed michaelg 9 2,631 11th May 13:57
Last Post: cooldeeps
  qTips no showing in IE7 adrielcrv 3 1,078 9th May 14:06
Last Post: Craig
  [Solved] Using 2 qtips on 1 element with different triggering events David 4 1,968 8th February 22:22
Last Post: ramalaks
  [Solved] My QTips not working on IE7 designlucas 2 762 7th February 14:40
Last Post: designlucas
  qTips and Wordpress davidcsonka 2 1,953 19th January 13:15
Last Post: GuillaumeL
  How to show/hide all qTips? nibl 1 2,445 27th October 00:18
Last Post: Craig



User(s) browsing this thread: 1 Guest(s)