/    Sign up×
Community /Pin to ProfileBookmark

Back button with layers

Hi everyone,
I am building a site using Dreamweaver MX using layers and I am having trouble with my navigation system.
I have a page, say page1, which has logos making up a navigation bar. Each logo when selected shows and hides certain layers. On these layers are links to a full version of the page.
When click to the full version, say page2, I can click a button that I named ‘back’ to return to where I came from.
But my problem is that when clicking the back button, page1 reloads from the beginning, i.e. showing the original layers before the user used the navigation bar.
I would like the user to be able to return to that last stage of the page with the last viewed layers but am not sure if this is possible??

I am fairly ignorant when it comes to programming and stuff so please bear in mind if you answer me!

Thanks,

Claire.

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JOct 04.2004 — You would need to assign a variable with the currently select layers ID and then have the back button reference this variable.

It really depends on how you have constructed your functions

function show_hide_layer(){

hide layer1 and show layer2

current_layer = layer2

}

function go_back(){

show current_layer

}

Does page2 replace page1?

Is the back button in page2?

If so you would have to amend your function to use the query string
Copy linkTweet thisAlerts:
@clairetocheauthorOct 04.2004 — Thanks for your reply.

I understand the idea but am not sure how the functions are built! I have used the show/hide layers function in Dreamweaver and the code is pretty lengthy as I have many layers. Also there are 2 navigations that do the same thing on the same page (page1).

Page1 has the layers and the show/hide functions.

Page2 replaces Page1 and has the back button.

At the moment, I have created several versions of my Page1 so that Page2's back button takes me to a specified version of Page1.

If it helps, it's here: http://www.moonlighting.uk.com/Quiz.html

The link 'more on this event' takes me to Page2 which has the back button on it...

Does this make any sense??

Claire.
Copy linkTweet thisAlerts:
@JPnycOct 04.2004 — Then your back button code must contain something like "history.go(-1) or something. The code that should be called on that back button is the code that calls the previous layer, not that does anything with the parent page at all.
Copy linkTweet thisAlerts:
@clairetocheauthorOct 04.2004 — I tried the "history.go(-1)" but that just takes me back to my page with the original layers showing...
Copy linkTweet thisAlerts:
@Mr_JOct 04.2004 — Take a look in the attached zip for an example

[upl-file uuid=10b39eec-c2a0-4ebf-832a-8dc18d3c3c5d size=1kB]new folder.zip[/upl-file]
Copy linkTweet thisAlerts:
@JPnycOct 04.2004 — That's what I'm saying. It SHOULDN'T contain history.go. It should contain only a call to a function that displays the last layer. But that's not going to be so easy for you to write. I never tried writing a function with dreamweaver, but I've seen the confusing convoluted code it spits out.
Copy linkTweet thisAlerts:
@clairetocheauthorOct 04.2004 — Thanks Mr J!

It seems to do what I want so I shall try and apply it...

Claire.
Copy linkTweet thisAlerts:
@Mr_JOct 04.2004 — Hi Claire.

Dunsel is right about DreamWeaver, it does tend to go overboard with its code.

I have been playing around trying to do you another example so that you can see how much over-coding DreamWeaver does.

See the attached zip file.

You will have to add images to the folder because the zip was too big to upload to this forum with them in.

I have added a list in the zip

[upl-file uuid=dad41328-2a2c-43e7-8568-899e7186f920 size=2kB]clairetoche1.zip[/upl-file]
Copy linkTweet thisAlerts:
@clairetocheauthorOct 05.2004 — Thanks for the file,

It's brilliant and saves me a huge headache!I am having lots of problems with Dreamweaver. As you both said, it seems to add bits of code not needed and when I delete or replace an element on the page, I get all sorts of errors. Is there somewhere on the net where I can learn more about writing code on its own?

Claire.
×

Success!

Help @clairetoche spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...