In this example, let's say I have two buttons that I want to have. Both of these have image pairs used for the rollovers.
These images are info.png and info_active.png for the first button. The second set is contact.png and contact_active.png.
Assuming I set up the array like you had suggested, then the script defining that array should look something like this:
This much is easy enough. I also set up theCode:var expandedbackgrounds=[] expandedbackgrounds[0]="url (info_active.png)" expandedbackgrounds[1]="url (contact_active.png)" var contractedbackgrounds=[] contractedbackgrounds[0]="url (info.png)" contractedbackgrounds[1]="url (contact.png)"onopenclose()function with the corresponding image I want based on its value in the array or so I am assuming.
Lets say I'm ready to set this up in the actual page code, using CSS as I'm doing it.
This is what my header's styles look like, most of which is relative to the script given in the original accordion code:
Because at the moment it makes no difference, I omitted the background image command so I'm not confusing anyone with code that is now obsolete.Code:.arrowlistmenu .menuheader{ font: bold 14px Verdana; color: white; margin-bottom: 1px; text-transform: uppercase; cursor: hand; cursor: pointer; height: 35px; }
Assuming I had a separate div for each header but using this CSS as reference, how would I tell my code to call from the array I had set up? Would I be using javascript inside of my CSS? Please keep in mind I'm as new as can be with javascript so specifics are appreciated.
Thank you.
EDIT: It seems I was creating this post as you replied to my previous ones. Thank you for answering my question about the javascript placement. The only one that remains is how to use this script once I've set it. The javascript is done, now how do I make CSS/html recognize it in my page?



Reply With Quote

Bookmarks