Tham khảo sách 'javascript bible_ chapter 50', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Application Outline-Style Table of Contents In your Web surfings you may have encountered sites that implement an expandable outline type of table of contents. I ve long thought that this element was a great idea especially for sites with lots of information. An outline as in the Windows Explorer or text-style Macintosh Finder windows enables the author to present a large table of contents in a way that doesn t necessarily take up a ton of page space or bandwidth. From listings of top-level entries a user can drill down to reveal only those items of interest. No matter how much I like the idea however I dislike visiting these sites. A CGI program on the server responds to each click chews on my selection and then sends back a completely new screen showing my choice expanded or collapsed. After working with outlines in the operating system and outliner programs on personal computers the delays in this processing seem interminable. It occurred to me that implementing the outline interface as a client-side JavaScript would solve the delay problem and make outlines a more viable interface to a site s table of contents. Design Challenges The more I looked into implementing an outline the more challenges I found ahead of me. The first problem was making the little icons widgets clickable so that they respond to user mouse actions. Even though images are objects in Navigator 3 and later they do not have mouse-oriented event handlers. Therefore it is necessary to surround each image with a link object whose HREF attribute calls a javascript URL and function to do the job. This technique also helps solve the next problem. In This Chapter Multiple frames Clickable images Multidimensional arrays Image caching Persistent data cookies Cascading Style Sheets 34 JavaScript Applications When a user clicks an outline widget the script must update the window or frame containing the outline to expand or collapse a portion of the outline. But we know that Navigator and Internet .