Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created July 25, 2011 11:53
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 mahemoff/1103969 to your computer and use it in GitHub Desktop.
Save mahemoff/1103969 to your computer and use it in GitHub Desktop.
Canvas-to-Canvas copy (jQuery+Kaffeine)
$.fn.copyTo = (target) -> {
src = $(this)[0]
$(target).each( () -> {
@.getContext("2d").drawImage(src,
0, 0, src.width, src.height,
0, 0, @.width, @.height
)
})
}
// $("src").copyTo("target")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment