Forum Moderators: not2easy

Message Too Old, No Replies

Remembering a DIVs display status

         

Stretch

1:54 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



I have 3 areas of a page in seperate DIVs. When the page loads DIVs 2 & 3 are set to display:none in the external style sheet.

Using links on the page I set DIV 1 to display:none and DIV 2 or 3 to display:block to reveal the previously hidden areas.

All works well except, if I visit a different page and then go back to the page with the DIVs it's always DIV 1 that's displayed.

Can anyone suggest a way of getting the DIVs to 'remember' their display status so when a user returns to the page it's in the same state they left it in?

Reflection

5:17 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



Refresh the page so that it goes back to its original state or use cookies.

Stretch

7:19 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



Thanks but my problem is that it is as if the page has already been refreshed. I don't want it to return to it's original state, I want it to stay in the last user selected state.

I'll look into cookies though.

Thanks.

Reflection

7:23 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



If thats the case you would have to go with a cookie and some javascript unless someone else can offer up a better solution?

DrDoc

9:12 pm on Nov 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CSS has only one state - default (= page load)
Anything that happens after that has really nothing with CSS to do. It is most likely handled by JavaScript.

Stretch

10:40 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



Thanks for that DrDoc. I may look into a JS/cookie solution but suspect rethinking the page build would be a better option.

Thanks to you both again.

Stretch