View Full Version : Mini Mods - MFF Tag Cloud In Footer

10 Aug 2008, 13:53
This is a really simple script which will add a tag cloud in the footer of your site (or wherever you put the code). Simply add this code:

<!-- TAG CLOUD -->
var advertiser = new Array();

advertiser[0]=["http://islandforum.net"," The Island"];
advertiser[1]=["http://www.myfootballforum.com"," My Football Forum"];
advertiser[2]=["http://www.myfootballforum.com"," Add Your Link Here"];

for( i=0; i<advertiser.length; i++){size = 8+(Math.random()*10);if( size < 9 ){color = 'red'}else if( size > 9 && size < 11 ){color = '#ffffff'}else if( size > 12 && size < 13 ){ color = 'yellow'}else if( size > 14 && size < 16 ){ color = '#ffffff'}else{color = '#ffffff';}document.write("<span style='font-size:"+size+"px;margin: 15px;'>");document.write("<a href='"+advertiser[i][0]+"' style='color:"+color+";text-decoration: none;' target='_blank'>"+advertiser[i][1]+"</a>");document.write("</span> ");}</script>
<!-- TAG CLOUD -->

It is all manual and to add or remove links you will have to edit the template where you add the code. Its a great hack as each time the page reloads, the links will be a different colour and size each time. You can change the size and the colour of the links in the bottom part of the code to whatever you want.

Demo is here, look at the footer:


Brandon Sheley
11 Aug 2008, 06:59
I don't see then in your demo?

11 Aug 2008, 13:34
Nevermind - That's not a tagcloud Dude - That's some sort of advertisement which you could easily have done with html. No need for javascript :-/


11 Aug 2008, 14:09
nice one. Thanks man.