WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Here I am with another question..., Guillermo, September 19, 2003
     Re:Here I am with another question..., Jarod, September 22, 2003
         Re:Here I am with another question..., Guillermo, September 22, 2003
             Re:Here I am with another question... , Guillermo, September 22, 2003
             Re:Here I am with another question..., Guillermo, September 22, 2003
     Re:Here I am with another question..., Erik Arvidsson, September 19, 2003
     Re:Here I am with another question..., Micha chopman, September 19, 2003

Subject: Re:Here I am with another question... From: Guillermo Date: September 22, 2003

Maybe with some sort of Array?

var estado_paneles = new Array();

estado_paneles["Panel1"] = block or none
estado_paneles["Panel2"] = block or none
...


 

From: Guillermo
Sent: September 22, 2003
Subject: Re:Here I am with another question...

Ok, I've managed to store some values in cookies, but I have some more questions:

Here's the script:

img_down = new Image(); img_down = "imagenes/layout/paneles/down.gif";
img_up = new Image(); img_up = "imagenes/layout/paneles/up.gif";

function toggleMenu( iNumber ) {
  if( document.getElementById("tblContent"+iNumber).style.display == "block" ) {
    document.images["flecha"+iNumber].src = img_down;
    document.getElementById("tblContent"+iNumber).style.display = "none";
 // Guardamos en cookies el estado del panel y la flechita
 document.cookie = "estado = none";
 document.cookie = "flecha = down";
  } else {
    document.images["flecha"+iNumber].src = img_up;
    document.getElementById("tblContent"+iNumber).style.display = "block";
 // Guardamos en cookies el estado del panel y la flechita
 document.cookie = "estado = block";
 document.cookie = "flecha = up"; 
  }
}

I save two cookies: "estado" and "flecha". The fisrt one is for saving the display state of the panel, the later is for saving the arrow image. However, the second cookie is not being written, what am I doing wrong??

Then, in every page, I set the panels style like this:

<%
Dim Flecha1, Estado1
Flecha1 = Request.Cookies("flecha")
Estado1 = Request.Cookies("estado")
%>

style="display: <% If Estado1= "" Then %>none<% Else %><% =Estado1%><% End If %>;"

I use an If ... Then because the cookie does not exist if this is the first time you access the site. If this is the case, "none" is applied to the table.

Now, the problem is that I can't use the same cookie for every panel, simply because the would be getting the same data.

How can I save the state of all the panels (5) at the same time? Let's say, Panel_1=block, Panel_2=none, Panel_3=block... etc.??


From: Jarod
Sent: September 22, 2003
Subject: Re:Here I am with another question...

Guille,

sos un ladri.. devolvele los colores a nvidia.


From: Guillermo
Sent: September 19, 2003
Subject: Re:Here I am with another question...

Ok, here I am with some more questions.... : )

I was wondering if it is possible to store or save style parameters in memory and use them in other pages. Go to http://www.cdbaires.com/sitio/ and you'll see some side-bar panels, wich are collapsible. This is done by changing the style="display:none" attribute to style="display:block" through JavaScript. However, when the user goes to a different page, all the panels are restored to their origianl state. What I'd like to do is keep the user's panel settings in memory, and bring those settings back in every page, so that the panels are in the same state as they left them.

The trick is, the page can't re refreshed everytime a panel is switched to store the data. I must be done in real-time.

Is this possible or I am nuts?!?







Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX