Working Around MooTools’ Tips / Rel=”NoFollow” Bug

By  on  

In MooTools 1.2, we saw the format of the MooTools Tip go from:

<a href="somewhere.php" class="tooltip-me" title="Title::Text">Tooltip Link</a>

... to ...

<a href="somewhere.php" class="tooltip-me" title="Title" rel="Text">Tooltip Link</a>

The one problem that this brought was that sometimes you don't want a search engine to follow a link, in which case you would add the following to the link element:

<!-- where do we put the text? -->
<a href="somewhere.php" class="tooltip-me" title="Title" rel="nofollow">

Obviously there's a conflict here as no one wants "nofollow" to be their tooltip's text. There are a few solutions to this.

1. Remove & Replace the Rel Attribute Before Creating Tips

	
$each($$('.tooltip-me'),function(el) {
	el.set('rel',''); //removes it
	// or
	el.set('rel','This is my tooltip text');
});
	

It's up to you whether you'd like to replace the "nofollow" text or simply remove it.

2. Revert to Title::Text in the Title Attribute

$$('.tooltip-me').each(function(el) {  
	var content = el.get('title').split('::');  
	el.store('tip:title', content[0]);  
	el.store('tip:text', content[1]);  
}); 

I prefer this method and used it in my previous MooTools tooltips article. You can follow the progress of this open MooTools ticket here.

Recent Features

  • By
    Create a CSS Cube

    CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals.  Add animation and you've got something really neat.  Unfortunately each CSS cube tutorial I've read is a bit...

  • By
    Send Text Messages with PHP

    Kids these days, I tell ya.  All they care about is the technology.  The video games.  The bottled water.  Oh, and the texting, always the texting.  Back in my day, all we had was...OK, I had all of these things too.  But I still don't get...

Incredible Demos

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!