This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Expand / Collapse of div elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Expand / Collapse of div elements" Watch "Expand / Collapse of div elements" New topic
Author

Expand / Collapse of div elements

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Hi Guys,

I have the following javascript function that does the expand / collapse of the div elements.



I would like to add a small image to the expand and collapse feature. Any idea on how to do it?

This is my HTML,



SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6


Eric
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

So now my javascript looks like this,



Even after this I'm not able to get the image on my screen? Did I go wrong anywhere?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It is not supposed to be e, it should be the button you clicked on. so you need the button's object there.

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Expand / Collapse of div elements
 
Similar Threads
Displaying progress text during body load
Javascript ScrollTo problem
Loading a page
style property value detection
How to create a slide menu in all browsers