Help - Search - Members - Calendar
Full Version: Set Link Active
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > JavaScript
MrTouz
Ive been searching over google but my keywords ar not good so i do not get good sites with what i need.
Ive looked around and saw some parts of code and the language needed for my problem.

See, i applied an effect to my links when they are set to active. When using .html pages i can set them to class="active", so each pages i will change the class="active" to its link so when user hits a page it is set to active.

The problem is, i am not using .html pages, which means i can not dirrectly set my pages to ="active" and when you switch to a page it changes to active :/

So i am looking for a javascript code that (once clicked) the link will basically turn on class="active", also it needs to set my home page as active. So when i start my page it directly puts my home button on active, once i click about us, it turns about us to active (keeps it active while i am on page ofcourse) ...

i think it has to do with onClick="" but i really can't figure it out :/
MrTouz
found out that it was impossible to stick the active class if the page reloads. and its wha happened with the script i had, it worked right before the page changes and than it disapeard.

Solution, well its the IF statement from PHP which sets the path in the browser and from this path it tells which ID to set the class="active" unfortunately it works only on direct paht such as /page.php and not inside page.php?id=something, which again screwed me over tongue.gif

Still searching but i guess its not a mater og Javascript.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.