$("span:last-child").hide("fast", function () {
$(this).prev().hide("fast", arguments.callee);
});
I can’t understand this point in the code:
-
("span:last-child"): what is this? -
arguments.callee: what is this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$is the main jQuery function.$("span:last-child")searches for any<span>tags that are the last child of their parent.Finds:
It would find the span that includes
testingbut not thesome data.It then hides those spans it found. The second argument to hide is a callback after the animation. That callback goes to the “previous” child (the ‘something else’ text node), hiding it and passing the “called function” (arguments.callee) as the callback. Which makes this a “recursive” function.
This would hide the entire contents of all blocks that have a
<span>as their last child.