Pages

Friday, 31 August 2012

Snap to Your Tiles In HTML5/JS Windows 8 App


Snap to Your Tiles In HTML5/JS Windows 8 AppLet’s say you have a bunch of tiles in your Windows 8 app and the user grabs this list with their finger and pans some distance to the right. There’s a chance the list will end up landing in a position like this… Notice that the tiles at left are cutoff. The list has panned some arbitrary distance and stopped where fate stopped it. I know it’s all scientific, but it’s fun to say that fate landed it here.

But what if you don’t want to put your app in fate’s fickle hands and would rather stop every time at a tile’s edge. That flick from my last example, then, should find you here……with the edge of tiles 9, 10, and 11 neatly lined up on your left margin.

Is that possible? Of course it is.

Is it easy? Yep. That too.

Once again, the custom CSS properties in Windows 8 come to the rescue. I’m going to talk about a couple of properties in the -ms-scroll* area. If you want a good list of the available properties, just type -ms-scroll in a CSS sheet and let IntelliSense be your guide.

Reade More...

No comments:

Post a Comment

Web Informer Button