Writing Applications with DOCJSLIB 2.0
onClick event handler. The best way to learn is by example. We'll show you, step by step, how to build the Pop-out Elements application, emphasizing the solution to these two items.
First, we need to design the mechanics of the pop-out elements. Our proposal is just one of many alternatives. You are encouraged to explore other designs. In our design, every pop-out element is a pair of an image and a box. The image looks like a folder tab and shows its index subject. In our pop-out example, the index tabs are
visibility property on and off.
As we mentioned above, managing the elements' IDs is one of your few challenges in building DOCJSLIB-based application. The image representing the index tab for
"examples" ID, while the other image for the
"columns" ID. As mentioned above, each image has a paired box that pops out when the image is clicked. Each box's label is comprised of its image's label, concatenated with the string
examples box is labeled
"examplesBox", and the
columns box is labeled
"columnsBox". As is explained in the next page, the heart of the algorithm is to derive the box's ID from the its corresponding image's ID, automatically. We chose the concatenation of the string
"Box" as the automatic derivation algorithm.
Created: October 26, 1998
Revised: October 26, 1998