Created
February 27, 2012 14:22
-
-
Save appleton/1924149 to your computer and use it in GitHub Desktop.
Troll any canvas element
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
var canvas = document.getElementsByTagName('canvas'), | |
img = new Image(); | |
img.onload = function(){ | |
Array.prototype.slice.call(canvas).forEach(function(el){ | |
el.getContext('2d').drawImage(img, 0, 0); | |
}); | |
}; | |
img.src = 'http://thegurglingcod.typepad.com/.a/6a00d8341c387d53ef0148c84decb8970c-320wi'; |
Good point, updated.
Related: one of the WAW entries uses a lot of canvas.
Also related: not our one.
Ohh dear, I am not enabling vandalism am I?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Surely to troll any element you want something more like: