a button content box?

hi
i hope i`m asking the question in the right place.
i want to create a content box which will be opened when the user clike on its "header" and closed when the user re-click on it.
so when he clicks the content box open and he can see the content and use it and when he want he can close it.


can it be done and how?


best regards

ron
LVL 1
derridaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dushan De SilvaTechnology ArchitectCommented:
What is language or softwaer you using?

BR Dushan
derridaAuthor Commented:
hi

dreamweaver


ron
Jason C. LevineDon't talk to me.Commented:
Hi derrida,

You can do this in Dreamweaver by creating Layers and using the built-in Show-Hide Layers behavior.  

Here's a very rough sample:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
#Layer1 {
      position:absolute;
      width:200px;
      height:115px;
      background-color:#66FFFF;
      layer-background-color:#66FFFF;
      border:1px none #000000;
      z-index:1;
      visibility: hidden;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
</head>

<body>
<p><a href="#" onClick="MM_showHideLayers('Layer1','','show')">This is a header</a></p>
<div id="Layer1">Hi I'm the layer </div>

<p>&nbsp;</p>
</body>
</html>

It's just a little javascript and CSS.

When you click on the header, the layer shows.  If you mess around with the behaviors and search for some tutorial, you can figure out how to make it close (either make a 2nd behavior to double click/close or have a link or graphic in the layer that is set to hide onClick.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
derridaAuthor Commented:
hi
i want to thank you for the reference . i had no idea that i need to do all this. i thought that i am asking a question and getting some help, and that`s it. i hope i`ll learn how to manage my questions effectively.


ron
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.