View Full Version : Altering colour of breadcrumb separator

08-28-2006, 09:48 PM

I am using the Javascript file below to generate breadcrumbs in my site at www.fuselearning.co.uk. I am not a javascript expert at all and got this code from another site, so I don't know what I am doing in terms of editing. I would like to control the colour of the ">" in my breadcrumbs. I have tried all kinds of fiddling with the HTML, but while I can affect the colour of the breadcrumb text, I cannot affect the ">" separator. Can anyone tell me how to do this. Sorry for the stupid newbie question, but it is driving me barmy!!!!!!!


var crumbsep = " > ";
var precrumb = "<span class=\"crumb\">";
var postcrumb = "</span>";
var sectionsep = "/";
var rootpath = "/"; // Use "/" for root of domain.
var rootname = "Home";

var ucfirst = 1; // if set to 1, makes "directory" default to "Directory"

var objurl = new Object;
objurl['softskills'] = 'Soft Skills';
objurl['ittraining'] = 'IT Training';
objurl['profskills'] = 'Professional Skills';
objurl['method'] = 'Methodology';
objurl['events'] = 'Events';
objurl['consult'] = 'Consultancy';
objurl['casestudies'] = 'Case Studies';
objurl['whoweare'] = 'Who We Are';
objurl['whatwedo'] = 'What We Do';
objurl['contactus'] = 'Contact Us';

// Grab the page's url and break it up into directory pieces
var pageurl = (new String(document.location));
var protocol = pageurl.substring(0, pageurl.indexOf("//") + 2);
pageurl = pageurl.replace(protocol, ""); // remove protocol from pageurl
var rooturl = pageurl.substring(0, pageurl.indexOf(rootpath) + rootpath.length); // find rooturl
if (rooturl.charAt(rooturl.length - 1) == "/") //remove trailing slash
rooturl = rooturl.substring(0, rooturl.length - 1);
pageurl = pageurl.replace(rooturl, ""); // remove rooturl fro pageurl
if (pageurl.charAt(0) == '/') // remove beginning slash
pageurl = pageurl.substring(1, pageurl.length);

Thanks for your help. Flunkie :-)

09-15-2006, 09:41 PM
"Driving me barmy"... I like that :)

I haven't tested this but can you change your first line of code to something like this, changing the color to whatever you want?

var crumbsep = " <span style='color:red;'>></span> ";

You may run into problems since you're using the ">" symbol, but if that happens try replacing it with "&gt;".