multiple tooltips in Joomla 1.6

Discussion regarding Joomla! 2.5 Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
moomoochoo
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Sat Mar 07, 2009 1:18 pm

multiple tooltips in Joomla 1.6

Post by moomoochoo » Tue Feb 01, 2011 2:59 pm

Hi everyone,
I am trying to have two separately styled tooltips on my Joomla 1.6 site.

I placed this code in my template

Code: Select all

JHTML::_('behavior.tooltip'); 
$toolTipArray = array('className'=>'ctt2');
JHTML::_('behavior.tooltip', '.TT2', $toolTipArray);
I then applied a span with the following code

Code: Select all

<span class="TT2" title="Text Tooltip Title::This is a tooltip attached to text">
   Hover on this text to see the tooltip</span>
It seems to have worked as the element appears as TT2 (when viewed with WebDeveloper), but when I try to style it with CSS, it doesn't work. I figure I must have made a mistake with the class names. Actually .ctt2 styling works, but nothing else. It seems to inherit the styling from the first tooltip (Incidentally, the first tooltip styles without any problems whatsoever). The first tooltip classes that I have been using are

Code: Select all

.tip-wrap    .tip-top   .tip   .tip-title   .tip-text  .tip-bottom 

I have been using the following class names for my second tooltip

Code: Select all

 .ctt2-wrap    .ctt2-top   .ctt2   .ctt2-title   .ctt2-text  .ctt2-bottom 

Can anyone see what I am doing wrong? Any help would be much appreciated. Thanks.

moomoochoo
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Sat Mar 07, 2009 1:18 pm

Re: multiple tooltips in Joomla 1.6

Post by moomoochoo » Sun Feb 06, 2011 4:12 am

Could this be a bug in Joomla 1.6 or am I doing something crazy?

moomoochoo
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Sat Mar 07, 2009 1:18 pm

Re: multiple tooltips in Joomla 1.6

Post by moomoochoo » Mon Feb 07, 2011 3:30 pm

I took a look at the javascript. This is what I found.

Code: Select all

window.addEvent('domready', function() {
			$$('.hasTip').each(function(el) {
				var title = el.get('title');
				if (title) {
					var parts = title.split('::', 2);
					el.store('tip:title', parts[0]);
					el.store('tip:text', parts[1]);
				}
			});
			var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
		});
		window.addEvent('domready', function() {
			$$('.TT2').each(function(el) {
				var title = el.get('title');
				if (title) {
					var parts = title.split('::', 2);
					el.store('tip:title', parts[0]);
					el.store('tip:text', parts[1]);
				}
			});
			var JTooltips = new Tips($$('.TT2'), { maxTitleChars: 50, className: 'ctt2', fixed: false});
		});

moomoochoo
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Sat Mar 07, 2009 1:18 pm

Re: multiple tooltips in Joomla 1.6 solved

Post by moomoochoo » Mon Feb 07, 2011 3:46 pm

Ok, I solved my own problem. The CSS for the second tool tip should be as follows;

Code: Select all

.ctt2 {}    .ctt2 .tip{}   .ctt2 .tip-title{}    .ctt2 .tip-text{}   .ctt2 .tip-bottom {}
I'm a little embarrassed by mistake, but hopefully this will help someone else!
Cheers


Locked

Return to “Performance - Joomla! 2.5”