SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot plan9's Avatar
    Join Date
    Jul 2004
    Location
    Portugal
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript navbar

    I have a problem with a javascript navbar in www.parlamento.pt/asg-plp-new/ the navbar puts in red the option of menuwhere we are, it serves to the users to know where they are, the problem is that I used absolute adressing to do this so and a collegue of mine is going to do a presentation with it on a local computer, possiblely in a local network, because the place where is goingo to do it so, probably has no intenet acess, well there is a problem with the adressing I had to pass all the adressing from absolute to relative and the red option, to tell users where they are stoped to work

    can anyone help me




    var navURLs = new Array('http://www.parlamento.pt/asg-plp-new/composicao/index.htm', 'http://www.parlamento.pt/asg-plp-new/estatutos/index.htm', 'http://www.parlamento.pt/asg-plp-new/legislacao/index.htm', 'http://www.parlamento.pt/asg-plp-new/eventos/index.htm', 'http://www.parlamento.pt/asg-plp-new/ligacoes/index.htm','http://www.parlamento.pt/asg-plp-new/contactos/index.htm','http://www.parlamento.pt/asg-plp-new/gestao/index.htm');
    var linkText = new Array('Composição','Estatutos','Legislação','Eventos','Ligações','Contactos','Login');

    function navbar() {
    var navStr= '';
    for (var i = 0; i < navURLs.length; i++) {

    navStr += '<span class= "menu-vermelho">| </span>';

    if (location.href == navURLs[i]){
    navStr += '<b><A class= "menu-vermelho" HREF="' + navURLs[i] + '">' + linkText[i] + '</A> </b>';
    }
    else{

    if (location.href != navURLs[i]) {

    navStr += '<A class= "menu-preto" HREF="' + navURLs[i] + '">' + linkText[i] + '</A> ';
    }

    }

    }

    navStr += '<span class= "menu-vermelho">|</span>';
    document.writeln(navStr );

    document.writeln('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class= "menu-vermelho">[ </span><a class= "menu-preto" href="http://www.parlamento.pt/asg-plp-new/index.htm">Página Principal</a><span class= "menu-vermelho"> ]</span>');

    }






    Thanks
    plan9

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! That's one long sentence. What's your question?

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wild guess:
    Code:
    function navbar()
    {
    	var i = 0, navStr = '';
    	for (i; i < navURLs.length; i++)
    	{
    		navStr += '<span class= "menu-vermelho">|</span>';
    		if (location.href.search(navURLs[i]) > -1)
    			navStr += '<b><A class="menu-vermelho" HREF="' + navURLs[i] + '">' + linkText[i] + '</A></b>'; 
    		else navStr += '<A class="menu-preto" HREF="' + navURLs[i] + '">' + linkText[i] + '</A> '; 
    	}
    	navStr += '<span class= "menu-vermelho">|</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="menu-vermelho">[</span><a class="menu-preto" href="http://www.parlamento.pt/asg-plp-new/index.htm">Página Principal</a><span class="menu-vermelho">]</span>'; 
    	document.writeln(navStr);
    }
    ::: certified wild guess :::


Bookmarks

Posting Permissions

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