Skip to content

Instantly share code, notes, and snippets.

@matharchod
Created January 12, 2012 22:10
Show Gist options
  • Save matharchod/1603450 to your computer and use it in GitHub Desktop.
Save matharchod/1603450 to your computer and use it in GitHub Desktop.
JSON object that uses jQuery to get width and height of viewport
var measure = {
'num' : 9,
'wHeight' : function(){
var h = $(window).height();
return h;
},
'wWidth' : function(){
var w = $(window).width();
return w;
},
'divis' : function(){
var x = measure.num / 3;
return x;
},
'sheight' : function(){
var y = measure.wHeight() / measure.divis();
return y;
},
'swidth' : function(){
var z = measure.wWidth() / measure.divis();
return z;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment