Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Altering colour of breadcrumb separator

    Hi,

    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!!!!!!!

    SCRIPT AS FOLLOWS:

    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 :-)

  • #2
    New Coder
    Join Date
    Aug 2006
    Location
    Illinois
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "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?

    Code:
    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;".
    Sarah


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •