Return to Snippet

Revision: 52920
at November 5, 2011 11:02 by FatFolderDesigner

Initial Code
var sizeable = 'body,#master,#content,#posts,#sidebar,#footer,#comments';
var sizes = {'450':'phone','750':'tablet','1000':'desktop'};
               var w = parseInt($(window).width());

Initial URL

Initial Description
I've previously posted this here:

This new version is short and more efficient, plus it no longer shows 1 (harmless) error on launch. Works the same as last time, the sizable object has the size to add the class too all the sizable elements, so for this example if the screen is less that 450px it'll add the class "phone" to the body (and the other elements), and if it's larger than 750px, but not 1000px, it'll give it the tablet layout. More information about the script is at the link, questions/comments/concerns can be sent to be from here or the comments section at the link.

Initial Title
Flexible Site Layout With Resize Detection, now improved!

Initial Tags
resize, mobile

Initial Language