Forum Moderators: open
I am working on a page with a script from Dynamic Drive called the "Contractible Headers" script. You can see the script here:
[dynamicdrive.com...] . I am using images instead of text, and you can see my implementation here:
<Sorry, no URLs. See TOS [webmasterworld.com]>
I have been asked by my client if there is a way that the next page can "remember" what happened on the last page: ie. if the person opens the Job Seekers menu and goes to another page, the browser would present the menu already open.
As a relative newcomer to JavaScript, I really have no idea if this is possible. I'm tempted to set up an external Javascript file: would that do it?
Thanks so much,
Cheryl
[edited by: tedster at 4:36 pm (utc) on Jan. 23, 2004]
Okay, I've been reading a few of these threads: maybe you can tell me if I'm on the right track with what I think I need to accomplish.
The cookie needs to be created when the user clicks on the "job seekers" button: I can do this using the onClick method? Then, I need to write something that has the browser search for the cookie when the page loads and if it exists, present the script as activated already?
Am I headed in the right direction?
Best regards,
Cheryl
Now, sorry to keep quizzing you but, here's my first road block: I can't figure out how to have 2 events onClick. Here is the two things I need to have happen:
The cookie (which I am hoping is formatted right):
<img onClick='setCookie("name", "save menu")'>
What is there already (the menu expansion):
<img onClick="expandcontent('sc1')" style="cursor:pointer; cursor:pointer" onMouseOver="MM_nbGroup('over','jobseekers','../graphics/jobseekersbuttondown.gif','',1)" onMouseOut="MM_nbGroup('out')" name="jobseekers" src="../graphics/jobseekersbuttonup.gif" border="0" onLoad="" width="132" height="22">
Would this be correct or is there a better way to do this? I'm really not sure about proper format/ order etc. or if it is even possible to have 2 events happen on one click.
<img onClick="expandcontent('sc1')" style="cursor:pointer; cursor:pointer" 'setCookie("name", "savemenustate")' onMouseOver="MM_nbGroup('over','jobseekers','../graphics/jobseekersbuttondown.gif','',1)" onMouseOut="MM_nbGroup('out')" name="jobseekers" src="../graphics/jobseekersbuttonup.gif" border="0" onLoad="" width="132" height="22">
Okay, I tried this method and as far as I can tell, it has created a cookie. However, Dreamweaver (I'm using 4.0) really doesn't like it: marks it invalid (for a "duplicate attribute") and severely messes up the display in Dreamweaver (although it displays fine in IE).
Any thoughts?
Cheryl
you could place your JavaScript in one frame which isn't reloaded (e.g. main navigation) - I think it even works when you place the script in the frameset itself; then just access it with parent.FrameName.function(); or parent.function();
but just do so if you already use a framset - don't make a framesite just because of that thingy.
just a thought..