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.

Now, once the browser width has been determined and the style sheet has been switched, we also set a cookie called<br />

res_layout that stores the title of the applied style sheet. On repeat visits, if the browser width is returned as 0 (that is, it is<br />

Internet Explorer 5.x), we check whether a cookie value exists for res_layout, and if so, immediately set the style sheet<br />

accordingly. This eliminates the flicker. We still go on to add the load listener that recalls getBrowserWidth(), so if the user<br />

happened to change the size of her browser after the cookie was set, we can adjust the layout to the new width.<br />

We’ve completed the resolution-dependent layout. Let’s move on to another approach.<br />

Modular layouts<br />

It’s one thing to provide a static choice of layouts depending on a user’s browser size, but it’s quite another to give users<br />

personal control over what they see on your page and where they see it.<br />

Modular layouts provide users with a visual and behavioral framework that allows them to radically change the way that an<br />

interface is displayed on a web page in real time. Once the designer has divided the content into discrete content modules,<br />

those modules can be expanded and collapsed, their order reorganized, and their position on the page changed—all by<br />

the user.<br />

Allowing the user to customize a page isn’t something you should offer haphazardly. It’s unlikely that someone<br />

will bother to spend the time investigating an interface and modifying it to his liking if he is going to<br />

spend only ten minutes there in his entire life. However, when you offer a service that aims to bring users back<br />

to your website often, and when they can gain some browsing or workflow efficiencies by customizing an<br />

interface, having a customizable layout can be quite an invaluable tool. The most likely candidate for a customizable<br />

layout is a web application, where users may want to perform only a subset of the tasks offered by<br />

an application, or where they regularly use specific functions in the application.<br />

chapter 9 Creating Dynamic Interfaces Using JavaScript<br />

223

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

Saved successfully!

Ooh no, something went wrong!