Sunday, 25 August 2013

Jquery .when() how to use?

Jquery .when() how to use?

having a bit of trouble with my jquery (as usual). I need one function to
execute only after the first one is complete, but I'm having trouble with
the syntax.. I've been reading about .when and callbacks but I can't seem
to get it to work. I'm not quite sure how to format my functions :-( Any
help?
$('#buttonone').hover(function () {
$('#descriptionone').fadeIn(400);},
function () {
$('#descriptionone').fadeOut(400);
});
$('#buttontwo').hover(function () {
$('#descriptiontwo').fadeIn(400);},
function () {
$('#descriptiontwo').fadeOut(400);
});
I'm just really confused where the .when goes! Any help would be
appreciated :-)

No comments:

Post a Comment