View Full Version : Turn a div into an image
02-22-2012, 01:15 PM
Ideally i want it to work something like
1) Link is pressed
2) div (#page) is turned into an image
Is anything like this remotely possible?
02-22-2012, 01:37 PM
Once you have an image, you can do some stuff with JS and CSS. Resizing an image fairly easily...just set the height and width attributes. You can also use CSS to apply some basic transforms to an image, though it's not going to be cross-browser. Here's a neat page on using webkit-transform (http://24ways.org/2009/going-nuts-with-css-transitions).
02-22-2012, 04:53 PM
I found html2canvas which gets a image, however currently itt just loads it directly into the body of the page, so i need to go through it and try and manipulate it a bit, however theres 2k+ lines of code so it might take me a while haha :p
02-22-2012, 05:22 PM
You can do some neat things with the new canvas element, just remember that older browsers don't have native support for this.
02-22-2012, 11:04 PM
Ooh, ill look into that thanks :). It's not important if older browsers don't support it it's just for some cool transitions for changing pages :p
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.