Web hosting e commerce - 1351Chapter 52 .Application: Outline-Style Table of Contents //

1351Chapter 52 .Application: Outline-Style Table of Contents // apply default expansion state from outline s header // info to the expanded state for one element to help // initialize currState variable function calcBlockState(outlineID, n) { var ol = document.getElementById(outlineID).getElementsByTagName( body )[0] var outlineLen = ol.getElementsByTagName( outline ).length // get OPML expansionState data var expandElem = document.getElementById(outlineID).getElementsByTagName( expansionState )[0] var expandedData = (expandElem.childNodes.length) ? expandElem.firstChild.nodeValue.split( , ) : null if (expandedData) { for (var j = 0; j < expandedData.length; j++) { if (n == expandedData[j] - 1) { return 1 } } } return 0 } The final act of the initialization process is a call to the initExpand() function. This function loops through the currStateglobal variable (whose value was written in makeHTML() with the help of calcBlockState()) and sets the display property to blockfor any element designed to be expanded at the outset. HTML element construction in makeHTML() is performed in such a way that each parent DIV has a SPAN nested directly inside of it; and inside that SPAN are all the child nodes. The displayproperty of the SPAN determines whether all of those children are seen or not. // expand items set in expansionState XML tag, if any function initExpand(outlineID) { for (var i = 0; i < currState.length; i++) { if (currState.charAt(i) == 1) { document.getElementById( OLBlock + i).style.display = block } } } By the time the initExpand() function has run a lot of setup code that executes pretty quickly the rendered outline is in a steady state. Users can now expand or collapse portions by clicking the widget icons. Toggling node expansion All of the widget images in the outline have onClick event handlers assigned to them. The handlers invoke the toggle()function, passing parameters consisting of a reference to the IMG element object receiving the event and the serial number of the SPAN block nested just inside the DIV that holds the image. With these two pieces of information, the toggle() function sets in motion the act of inverting the expanded/collapsed state of the element and the plus or minus version of the icon image. The blockNumparameter corresponds to the position within the currState string of 1s and 0s holding the flag for the expanded state of the block. With the current value retrieved from currState, the value is inverted through
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

2 Responses to “Web hosting e commerce - 1351Chapter 52 .Application: Outline-Style Table of Contents //”

  1. epysinalihac Says:

    epysinalihac…

    Free Printable Birthday Party Invitation Template

  2. qylajafoq Says:

    qylajafoq…

    myspace monster drink layout

Leave a Reply