Adding the Date Panel

The Date panel looks a lot like the previous panels, with a couple of exceptions (refer to Example 4-4). Add the HTML for the Date panel right after the Dates panel, just before the closing </body>.

Example 4-4. The HTML for the Date panel

<div class="toolbar"> <h1>Date</h1>

<a class="button back" href="#">Back</a> <a class="button slideup" href="#createEntry">+</a> </div>

<ul class="edgetoedge">

<li id="entryTemplate" class="entry" style="display:none"> <span class="label">Label</span> <span class="calories">000</span> <span class="delete">Delete</span> </li> </ul> </div>

O The Date panel toolbar has an additional button. When clicked, this button will display the New Entry panel (which we have not yet built). The link has a class of slideup, which tells jQTouch that we want the target panel to slide up from the bottom of the screen, rather than in from the left or right like normal navigation.

© The other unusual aspect of this panel is that we define a list item with the style set to display:none, effectively making it invisible.

As you'll see in a bit, we'll use this invisible list item as a template to display entries once they are created. At this point, there are no entries, so the panel will be empty aside from the toolbar.

Now that you've added the Date panel, clicking any item on the Dates panel will slide the empty Date panel (Figure 4-5) into view.

Figure 4-5. Other than the toolbar, the Date panel is empty to begin with
0 0

Post a comment