13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

226<br />

The markup<br />

The high-level structure of the page content is fairly simple. The data modules on the left are contained in their own section,<br />

followed by the central content, then more data modules on the right:<br />

<br />

. . .<br />

<br />

<br />

. . .<br />

<br />

<br />

. . .<br />

<br />

The most important thing to note here is that if the user moves content from one module area to the other, it must be<br />

placed into the appropriate container.<br />

The HTML for your web page doesn’t have to strictly follow the template laid out in modular.htm. However,<br />

the JavaScript and CSS used in the example are tailored for that markup and would need to be tweaked<br />

according to the way your particular page is laid out.<br />

Inside each of the module areas, we separate each of the modules into its own section, using a div with a class of module:<br />

<br />

<br />

<br />

Search<br />

<br />

<br />

. . .<br />

<br />

<br />

Most of our JavaScript will be focusing on this h2 element, as it provides the handle with which to perform the expand/<br />

collapse and moving actions. We’re not concerned with the HTML contained inside the moduleContent div, as that’s specific<br />

to each module. We just want to abstract our framework to deal with each module block.<br />

Expanding and collapsing modules<br />

The ability to expand and collapse content is not a new concept, and it’s actually quite simple. Probably the most important<br />

thing we can do is to keep it unobtrusive and accessible.<br />

On the unobtrusive side of things, users who do not have JavaScript turned on should not be offered functionality that they<br />

cannot access. This means that the elements that allow for expanding/collapsing should be included via the JavaScript itself.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!