1339Chapter 52 .Application: Outline-Style (Web hosting uk) Table of Contents browser-specific

1339Chapter 52 .Application: Outline-Style Table of Contents browser-specific branches use a great deal of the code. Inside the large for loop, a CSS branch dynamically changes the setting of the style.display property. For NN4, the page is reloaded after all changes to the cookie version of the state are saved. After the NN4 version goes off to reload the page, the CSS version swaps the image of the toggled widget. As a final touch, the window is given focus so that IE/Windows browsers lose the dotted rectangle around the clicked image. // **function that updates persistent storage of state** // toggles an outline mother entry, storing new value function toggle() { var newString = var expanded, n // get all

tag objects in IE4/W3C DOMs if (document.all) { var allDivs = document.all.tags( DIV ) } else if (document.getElementsByTagName) { var allDivs = document.getElementsByTagName( DIV ) } var currState = getCurrState() // of whole outline // assemble new state string based on passed parameters for (var i = 0; i < arguments.length; i++) { n = arguments[i] expanded = currState.charAt(n) // of clicked item newString += currState.substring(0,n) newString += expanded ^ 1 // Bitwise XOR clicked item newString += currState.substring(n+1,currState.length) currState = newString newString = if (isCSS) { // dynamically change display style without reloading if (expanded == 0 ) { allDivs[n].style.display = block } else { allDivs[n].style.display = none } } } setCurrState(currState) // write new state back to cookie if (isNN4) { location.reload() } // swap images in CSS versions var img = document.images[ widget + (arguments[0]-1)] img.src = (img.src.indexOf( plus.gif ) != -1) ? minus.gif : plus.gif window.focus() } A prerequisite for loading the page to begin with is setting the initial value of the state. This is the only part of the script that must be hard-wired based on the structure of the outline string assigned to initState will be different with each outline. The goal here is to set each block assigned to the indent0 style class to 1
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Leave a Reply