Skip to content

Instantly share code, notes, and snippets.

@jasonwyatt
Created September 22, 2010 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonwyatt/592013 to your computer and use it in GitHub Desktop.
Save jasonwyatt/592013 to your computer and use it in GitHub Desktop.
dojo.require('dojo.window');
dojo.addOnLoad(function(){
var body = dojo.body(),
footerId = 'footer'; // change this to whatever your footer's id is.
function adjustFooter(){
dojo.create('div', {style: 'clear:both', id: 'adjustFooter'}, body);
var bodySize = dojo.marginBox(body),
windowSize = dojo.window.getBox(),
changes = { 'bottom': '0px', 'clear': '', 'position': 'absolute' };
dojo.destroy('adjustFooter');
if(windowSize.h < bodySize.h){
changes = { 'bottom': '', 'clear': "both", 'position': 'relative' };
}
dojo.style(footerId, changes);
}
adjustFooter();
dojo.connect(window, 'onresize', adjustFooter);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment