I'm designing a complex web form (for trained users, not drive-bys) that has many sections, many of which contain subsections. The form could become quite long, depending on the situation. Usability would be greatly enhanced if (sub)section headers would remain visible until the (sub)section has completely scrolled past.
For example, when scrolling through music artists on the iPhone, the "A" header remains visible until the "B" header scrolls up, bumping "A" up and off the screen. Similarly, Excel allows you to freeze the top row of a table, although this isn't quite as rich as the iPhone example.
Is this possible with HTML/CSS or will it require JavaScript too? Are there any examples out there of this type of behavior? Any tips or leads you could offer? I don't even know where to begin.
Edit: So I'm thinking the header div should be top-aligned with the intersection of the view pane and the content div:
+--------------+ | [content] | +-------------------------+ | | +----------+ | | | | | [header] | | | | | +----------+ | | | | | | | | | | | +--------------+ | | | | [view pane] | +-------------------------+