Hi there
I have a function
function preloadImage() {
varLink=".... link to my picture..."
$("#picture").attr("src", varLink).one("load", function() {
// This is called after the image is loaded
}}
Now I call this function many times in my jquery script. But I need it to call different functions after the image is loaded. Is there any more elegant way to do that instead of sending parametrs to function like:
function preloadImage(action)
and making several if then statements after the function is executed to replace the: // This is called after the image is loaded in my code?
So I basically need to do several things after image is loaded (callback) so I have to call this function with several different parameters or is there any other way?
Thank you
Jerry