$('<div id="xxx"></div>')
.call_plugin()
.append('<div id="yyy"></div>')
.find('#yyy') // added this. From now on the current selection is #yyy element
.call_plugin(); // this will be called on #yyy
如果您想继续使用同一链中的前一个选择,则 该.end()
方法(您在最后使用的方法)用于结束链中的当前选择...
在你的例子中
$('<div id="xxx"></div>')
.call_plugin()
.append('<div id="yyy"></div>')
.find('#yyy') // added this. From now on the current selection is #yyy element
.call_plugin() // called on #yyy
.end() // this returns the selection to be #xxx
.something()//something else that will be called on #xxx