jQuery chaining: Can everything be chained? When can we not chain?

前端 未结 4 1354
长发绾君心
长发绾君心 2020-12-10 03:05

I know that not all jQuery functions can be chained together. Is there a rule of thumb on this. When can we not chain 2 functions together.

4条回答
  •  庸人自扰
    2020-12-10 03:35

    if in the plugin they do:

    return this; //<--jquery object
    

    at the end then u can change it with other plugins :-)

提交回复
热议问题