I want to know if the jQuery transfer effect has any callback mechanism by which I can determine when a transfer effect starts and when ends. I got the code below, but I found no callback function…
Please help. Thanks.
$("div").click(function () {
var i = 1 - $("div").index(this);
$(this).effect("transfer", { to: $("div").eq(i) }, 1000);
});
Assuming you're talking about jQuery UI's effect
method, then it takes a callback
function as an argument. That callback will run when the effect has completed:
$(this).effect("transfer", { to: $("div").eq(i) }, 1000, function() {
//Done!
});
As for when the effect starts, the lines following the call to effect
should be run immediately after the call (so before the effect is complete).
The documentation for the "Transfer effect" does not state so, but the documentation for effect
does state that a callback can be specified. Obviously this is the completion callback.
effect( effect, [options], [speed], [callback] )
As for when it starts, you must assume that is "immediately".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With