PDA

View Full Version : Show Div. Simple javascript question.



shapper
03-18-2006, 10:50 PM
Hello,

I am starting to use javascript and I need to create something simple.

I have an image on my page. I need to show a div with its contents when the image is clicked. The div must float on my web site 50px over and 10px right to the image position. Inside the div i must have a link to close it.

If i could have some fade in and fade out on the div that would be great but this is not important.

I have been looking for such an example but i can't find it. I am probably looking in the wrong places since this is so common.

Could someone please help me?

Thank You Very Much,
Miguel

sleipner
03-19-2006, 09:39 AM
I used the contractible headers script (http://www.dynamicdrive.com/dynamicindex1/navigate2.htm), but most any of the expanding menus in the menu area here on dynamic drive serve the purpose well enough - just put the content in the space instead of menu links - and btw: you can typically use span and other elements if you want instead of div or whatever the script says, depending on which suits the purpose better, span is more flexible in my opinion