File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 9351
    
    2

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, Certified Scrum Master
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: 9351
    
    2

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Expand / Collapse of div elements