触发附加到它自己的对象但在链内的事件处理程序?
现在我有:
$("#myElement").bind("buildTimeline", function (event, newViewObj) {
curDomObj = $(this).children(".timeline"); //this refers to #myElement
curDomObj.draggable({
axis:"x",
drag:curDomObj.trigger("drag")
});
});
我宁愿只有一个链,但是有没有一种方法可以引用链中您所在位置的当前元素?:
$(this).children(".timeline").draggable({
axis:"x",
drag:$(this).trigger("drag") //this still refers to #myElement, but I want
//it to refer to #myElement .timeline
});
Right now I have:
$("#myElement").bind("buildTimeline", function (event, newViewObj) {
curDomObj = $(this).children(".timeline"); //this refers to #myElement
curDomObj.draggable({
axis:"x",
drag:curDomObj.trigger("drag")
});
});
I'd much rather just have one chain, but is there a way to refer to the current element at your position in the chain?:
$(this).children(".timeline").draggable({
axis:"x",
drag:$(this).trigger("drag") //this still refers to #myElement, but I want
//it to refer to #myElement .timeline
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样:
What about: