View Full Version : navigation bar in frames, back button
tesscm
10-14-2002, 10:51 AM
I designed my site with a constant navigation bar in the left frame. If a button is clicked, the button shows its 'down' state ( inverse colors when its page is being displayed). However, if the user clicks on the back button, the button stays in its 'down' state even though the user is now on a different page. Is there any way to get the navigation bar to reflect that the user is now on a different page (i.e., by showing the appropriate button in its down state?) even though the 'back' button was used to get there?
Mhtml
10-14-2002, 01:34 PM
This is really a javascript issue, so you can either delete this thread or wait until (or if) it is moved.
If you show me the code I may be able to help you.
tesscm
10-14-2002, 02:19 PM
The code is at www.devorapublishing.com/navigationbar.htm.
Thanks in advance.
brothercake
10-14-2002, 02:31 PM
What you need is a timeout to track the location.href of the target frame, and then update the navbar colors when it changes
tesscm
10-14-2002, 04:20 PM
Brothercake,
Where can I find an example of a timeout?
brothercake
10-14-2002, 04:30 PM
here's a simple example
function checkUrl() {
var ddl = parent.contentFrame.document.location.href;
if(ddl.indexOf("page.html") { ... change color ... }
}
var historyTimer = setTimeout("checkUrl()",500);
A more complex example can be found at http://www.brothercake.com/scripts/tabs_demos/frameset/frameset.html which does exactly what you;re after
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.