I'm using this JQuery UI component:
http://docs.jquery.com/UI/Effects/Transfer
My code is this:
$(".button").click(function () {
var source = $(this).attr("src");
$(".ui-effects-transfer").css("background-image", "url("+source+")");
$(this).effect("transfer", { to: $(".target") }, 1000);
});
But this line doesn't affect transfer script:
$(".ui-effects-transfer").css("background-image", "url("+source+")");
How can I fix this?
$(".button").click(function () {
var source = $(this).attr("src");
$(this).effect("transfer", { to: $(".target") }, 1000); // <- comes first
$(".ui-effects-transfer:last").css("background-image", "url(" + source + ")");
});
Working example