Web Analytics Made Easy -
StatCounter Contractible Header Problem - CodingForum

Announcement

Collapse
No announcement yet.

Contractible Header Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Contractible Header Problem

    Hey, Everyone--

    I am using the Contractible Header script from DynamicDrive.com and have a concern that I would so appreciate some help with if anyone has a moment.

    Ref: http://www.dynamicdrive.com/dynamicindex1/navigate2.htm

    I am using IE 5.5, so it is not a browser issue, but when I view the page I created, all of the headers are "open" and exposing all of the content immediately. I chose this script because there is a great deal of information I want to be able to share, but I don't want my viewers to have to scroll for days to get to it.

    Could someone please tell me how to manipulate the code so that the folders are not automatically open when I go to the webpage. It is probably something that needs to be "tweaked" that I cannot seem to figure out. I'm currently trying to teach myself javascript after having taught myself HTML.

    Any help would be appreciated.

    Regards,
    Nicholas

  • #2
    hi,
    by default, they should be closed. if using FrontPage to view, they sometimes will show opened, but will be okay once its viewed in a browser. can you post your code here?

    Comment


    • #3
      Hi, and thanks for replying....

      I am including the script from Dynamicdrive.com that I am using and am using FrontPage2000 to build it on an intranet server, so I can't post specific information. But when I pull it up on a browser, it has all sections open.

      ----------------------------------------------------------------------------------

      The portion that fits into the Head is:

      <script language="JavaScript1.2">
      <!--

      /*
      Contractible Headers Script- © Dynamic Drive (www.dynamicdrive.com)
      For full source code, 100's more DHTML scripts, and TOS,
      Visit http://www.dynamicdrive.com
      */

      var ns6=document.getElementById&&!document.all?1:0

      var head="display:''"
      var folder=''

      function expandit(curobj){
      folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
      if (folder.display=="none")
      folder.display=""
      else
      folder.display="none"
      }

      //-->
      </script>

      ----------------------------------------------------------------------------------

      The portion that fits into the BODY is:

      <h3 style="cursor:hand" onClick="expandit(this)">Header 1</h3>
      <span style="display:none" style=&{head};>
      This is content under Header 1.
      </span>

      <h3 style="cursor:hand" onClick="expandit(this)">Header 2</h3>
      <span style="display:none" style=&{head};>
      This is content under Header 2.
      </span>

      ----------------------------------------------------------------------------------

      Isn't there a line of code that can be put in there to close all folders when you open the page?


      Regards,
      Nicholas

      Comment


      • #4
        For my situation , they are closed in the beginning too.


        But , I have a browser problem , can anyone help me...

        this code is said to be run well in NS6,but when I insert

        a table into <span> , it cannot work well (in NS6 ). Why?

        How can I fix it?help me~
        I am not an english native speaker.
        If i don't express clearly,please bear with me.THANK YOU :)

        Comment


        • #5
          hi,
          it doesn't work well in a table in NS6+

          http://astro.phpwebhosting.com/~a206...icdrive/ch.htm

          Comment

          Working...
          X