The Following code determines the sources of two images within an HTML5 Canvas:
var sources = {
darthVader: “darth-vader.jpg”,
yoda: “yoda.jpg”
};
Is there a way I can change the source of these images using jquery?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think @robertc has what you are after, alternatively if your images are stored elsewhere and you want to update the canvas based on an event (e.g. a link/image click) you would need to do something similar to the following;