Created
March 14, 2011 21:58
-
-
Save bxt/869963 to your computer and use it in GitHub Desktop.
Keep an html5-canvas element resized across the whole browser window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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