I Liked the example, made it more simple.. Thanks — isJustMe. Instead of return obj , can you say return this? Because I tested and it gives me the same result.
Derek: You could do that, because this in the functions in the example will be the object each method was called on. Show 1 more comment. Tejs Tejs Daniel A. White Daniel A. White k 43 43 gold badges silver badges bronze badges. GSto GSto The point is that a function must evaluate to the "parent" function. Muhammad Usman Muhammad Usman Himanshu Jansari Lothian Matthew. Lothian 2, 16 16 silver badges 21 21 bronze badges. Chaining is used to connect multiple events and functions in a selector.
Community Bot 1 1 1 silver badge. Srikrushna Srikrushna 2, 1 1 gold badge 31 31 silver badges 38 38 bronze badges. Hamdy Saady Hamdy Saady 11 4 4 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
The Overflow Blog. Podcast Quality code is the easiest to delete. Upcoming Events. Featured on Meta. Now live: A fully responsive profile. Candidate changes in Moderator Election — review your ballot. Linked 3. See more linked questions. Related Hot Network Questions. Chaining allows us to run multiple jQuery methods on the same element within a single statement.
However, there is a technique called chaining, that allows us to run multiple jQuery commands, one after the other, on the same element s. The following example chains together the css , slideUp , and slideDown methods. The "p1" element first changes to red, then it slides up, and then it slides down:.
Tip : When chaining, the line of code could become quite long. However, jQuery is not very strict on the syntax; you can format it like you want, including line breaks and indentations. We just launched W3Schools videos. Get certified by completing a course today! If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:.
0コメント