The "z-index" parameter detemines the stacking order of positioned objects that are overlapping. It is used to bring an object to the front of another object without changing the visibility of either object.
The "display" parameter detemines how an object is displayed in the flow of the document: "inline", "block" or "none". It is used to expand and collapse things, like an outline or menu.
The "visiblilty" parameter determies whether an object is visible or not: "visible", "hidden" or "inherit". It is used to selectively show and hide portions of a document.
ok I think I understand a little better..
can you help me write it out, or point to an example?
(I know my syntax is bad.. corrections and flames welcome)
var Status == getCookieValue(myCookie)
if Status = "taken";
{
(id=Poll style="visibility: hidden")
(id=Results style="visibility: visible")
}
else
{
(id=Poll style="visibility: visible")
(id=Results style="visibility: hidden")
}
I'd been working with this script previously.. and it seemed to work just fine (commented out what I added, and it didn't show any errors)
what platform/browser are you running?
Your getCookieValue() function does not seem to return the cookie correctly. I couldn't debug the page any further, and gave up. Perhaps someone with more patience with cookie scripts and such will pick up this thread.
I'm sorry Gil, I'm new here and certainly didn't mean to cause such a reaction within days of registering..
for anyone else with patience remaining.. I've updated the cookieScript to something seemingly more stable.
The original problem still remains, I need only one of the div's visible based on the conditional. here
Well, I looked at your latest, and you have cleaned up the cookie crumbs.
I can now see your logic problems.
You cannot change the visibility of an object until it exists. You need to make both divs "hidden" by default. Then in an "onLoad" script, act accordingly.
Add the visible decisions to the existing "onLoad" script. This stuff:
Put it in a function and get rid of the first cookie call (not necessary, doesn't do anything) and the first set of braces. Call the function somewhere in the "onLoad".
Change the "div" styles, either inline or using a style sheet. For example (using the ID's so you can change the type of tag if you want):
Bookmarks