Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
August 25, 2008 - Time to Vote for the August 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 30, 2008, 06:30:10 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Visibility of a layer  (Read 518 times)
CMK
Space Explorer
***
Offline Offline

Posts: 7


« on: September 18, 2006, 09:45:44 PM »

When leaving a page where a layer is visible (it was initially hidden) and returning via the my brower's (IE) back button, the layer becomes hidden.  Why is this happening?  How can I prevent it?
Logged
RandyT
Global Moderator
Über Jedi
*****
Offline Offline

Posts: 2559


Amy's Personal Assistant


« Reply #1 on: September 18, 2006, 09:50:38 PM »

CMK, I am not sure what you are referring to, could you provide a link to it so we may re-create this "disappearing hidden layer" you speak of ?

Thanks !
Hope this helps,

RandyT
Logged

Randy T.
DSB
Computer Nerd
Jabba the Hutt
*****
Offline Offline

Posts: 600


Programmer of things...


WWW
« Reply #2 on: September 18, 2006, 10:31:56 PM »

Sounds like a caching problem.  I have never tested to see if CSS caches in the manner you are expecting.

Have you messed with the way your browser checks the cache?  If not, then it probably won't do what you are expecting without storing a session and doing some scripting.
Logged

GMTurner
Berserker Poster
*****
Offline Offline

Posts: 7539



WWW
« Reply #3 on: September 19, 2006, 07:52:17 AM »

Just to make sure I understand the issue...

User visits a page (page 1) that has a hidden layer
User takes some action on the page and the layer becomes visible
User visits another page (page 2)
User returns to page 1 and the layer is hidden again

You want the layer to remain visible when they return...

I think DSB is on the right track with caching. Basically, when the user returns to the page it goes back to the default settings which had the layer hidden. The only way I can think to get around this is to have it store information on the client machine (e.g. using a session or cookie of some kind) that indicates what layer was visible. Bascially, when the user visits the page it checks the value of the cookie. Depending on that value it determines dynamically which layer should be visible. This could be done using sessions and/or cookies in PHP, but it could also be acheived using cookies and javascript I believe... at least I think you could have javascript check the value of the cookie and dynamically create the CSS code for whether the layer was visible or not... I would probably use PHP to do it because I'm more comfortable with PHP than javascript these days, but I think either should work...
Logged

The above post was made at a time when I gave a dang and doesn't necessarily reflect my current views or opinions.

For those no longer with us ... Grr..!!

The Redheaded Penguin
CMK
Space Explorer
***
Offline Offline

Posts: 7


« Reply #4 on: September 19, 2006, 09:12:47 PM »

You are right on the money - that is exactly what is happening!

I'm new to all this - it doesn't make sense to me that all the input in all the form fields is as it was upon returning but the layer (you are correct - initially hidden but then made visible by selection of a radio button) is not.   Confused

I've written some PHP code in other pages but not yet using cookies or session varibles - I guess it's time to start.  Is there a specific variable that I should be looking at?

Thanks for your help.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM