I wish to find out if I can achieve that img
or input
HTML can use image object data present in JavaScript variable.
<input class="scroll" type="image" id="SCR_BoostWeapon" src="" title="Increase your sword skill" />
$("#SCR_BoostWeapon").attr("src", SPRITE.SCR_BoostWeapon.src);
I can link the source of image in <input>
to image object SPRITE.SCR_BoostWeapon
, which was preloaded. However I can only link src
property of the image object to src
property of input
element. Consequently, the browser loads the image again (from server or cache).
What I would like to achieve is to manipulate input
or img
HTML element to use image data already present in image object; not src
but rather 'pointer' to image data.
Is this possible? If it is, how?