My question is rather basic, but I can't find it out.
I have a quite big library of images to display in my website, so I've written a jQuery script to scan the folder, gather sources of images and put them as a background-image in the right place. That works perfectly.
My second step is to prepend a copy of an image above it and process it with Pixastic library. I tried with the code shown below:
function blurBackground() {
$wrapper2.prepend('<img class="blur" src="'+$sourceImage+'" />'); // great, a copy of the image is set!
$('.blur').load(function() { // execute on load
$('.blur').pixastic("blur").css('border','10px solid red'); // failed to process with pixastic, succeded to edit css
});
}
If I have an existing <img src="something.jpg" class="blur" />
in my markup everything works perfect, even if I strip the function down and use only that code:
function blurBackground() {
$('.blur').pixastic("blur");
}
The problem is I cannot process any image which is prepended or appended.
I have no idea what I'm doing wrong. $sourceImage is 100% correct, and the image is always cached before the execution of the function.