View Full Version : Centralize Navigation
saeed
01-01-2003, 09:24 AM
I am currently using the whole html code for navigation purpose which is repeating in all pages.
but the only diffrence is that current page link is disabled having a color red. and all other links are same.
I want to know can I control this through JavaScript.
actually I want to centralize this code. to avoid loading the html
code again and again.
any help will be appreciated.
see the
sample page (http://www.htcpak.com/msq/sample/index.html)
duniyadnd
01-01-2003, 09:48 AM
dont know what you mean by control. If you want to control something easily, all you have to do is create a css class and call that in, and you just have to call that in.
A good place to learn about Cascading Style Sheets (CSS) is http://www.w3schools.com
That's to "centralize" (as you put it) the controls for the visual attributes for things such as fonts, color, bordercolor etc.
Duniyadnd
saeed
01-02-2003, 08:19 AM
First see the sample website for this purpose.
Sample Website click here (http://www.htcpak.com/msq/sample/index.html)
see the navigation on top. I had just used simple html codes again and again in all the pages. the only diffrence is that current page (means if I am on Home page or whatever page you are at that moment) link is dissable and I had assigned a red color to that text. For more clearance navigate through the website.
now the problem is that I want to get rid of that html code to use it again and again in every page and wanted to done this through javascript. can it will be done easily or not. if yes then how. please help me out.
waiting for your reply.
Regards,
S@eed.
joeframbach
01-02-2003, 11:48 AM
why not use frames?
joeframbach
01-02-2003, 12:04 PM
...i know what your next question will be...:rolleyes: it might not work because its 7:00 am
function confirmEnable(newLink)
{
var prevSite=document.referrer;
if(prevSite.indexOf('htcpak.com/msq/sample/')!=-1)
{
var prevSite=document.getElementById(prevSite.split('htcpak.com/msq/sample/')[1].split(".html")[0]);
prevSite.style.color='black';
prevSite.href=prevSite+".html";
}
newLink.style.color='red'
newLink.href=''//im really sorry, i dont know how to remove a href
}
<A id=introduction onClick='confirmEnable(this)' href=introduction.html>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.