a button content box?

Posted on 2006-03-30
Last Modified: 2010-04-25
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

Question by:derrida
    LVL 17

    Expert Comment

    What is language or softwaer you using?

    BR Dushan
    LVL 1

    Author Comment



    LVL 70

    Accepted Solution

    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:

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    #Layer1 {
          border:1px none #000000;
          visibility: hidden;
    <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 ( {; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
        obj.visibility=v; }

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


    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.
    LVL 1

    Author Comment

    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.


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
    This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now