Hi Marius,
That is actually a pretty good idea. You can still have your other code run at document ready, but then do the drawing to canvas once the image is ready. Best of both ;) Thanks, Schalk From: Marius Gundersen [mailto:[email protected]] Sent: Monday, May 24, 2010 4:49 AM To: Schalk Neethling Cc: [email protected] Subject: Re: [whatwg] Canvas and Image problems You could also add a listener to the image to check that it actually loads: $(document).ready(function() { var image = $("#cat").get(0); image.onload = function(e){ var cv = $("#img_container").get(0); var ctx = cv.getContext('2d'); ctx.drawImage(image, 0, 0); }; }); On Sun, May 23, 2010 at 10:30 PM, Schalk Neethling <[email protected]> wrote: Jip, using $(window).load() works perfect.
