Chaining Different Effects

Explore the concept of chaining in jQuery and its advantages, along with an example.

What is the chaining of effects?

jQuery allows us to chain together different effects for a single selector. The chained effects are placed in a queue and executed in that sequence. The syntax for chaining different effects is straightforward and given below:


The effectA() takes place first. When effectA() concludes, effectB() begins its execution, and so on until all the N effects complete their execution.

πŸ“ Note:

  • Chaining allows us to use a single selector to perform a series of effects instead of continually using the same selector. This significantly reduces the overhead time overhead as the browser does not need to repeatedly look for the same element.
  • We can also use the animate() method within a jQuery chain.

Get hands-on with 1200+ tech skills courses.