Skip to content

Instantly share code, notes, and snippets.

@bxt
Created March 14, 2011 21:58
Show Gist options
  • Save bxt/869963 to your computer and use it in GitHub Desktop.
Save bxt/869963 to your computer and use it in GitHub Desktop.
Keep an html5-canvas element resized across the whole browser window
jQuery.fn.fullscreenCanvas = function() {
var els=this;
$(window).resize(function() {
els
.css({position:"fixed",left:0,top:0})
.attr("width",$(window).width())
.attr("height",$(window).height())
;
});
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment