现在我有:
$("#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
});
答案 0 :(得分:0)
怎么样:
$("#myElement").bind("buildTimeline", function (event, newViewObj) {
$(this).children(".timeline").draggable({
axis:"x",
drag:$(this).children(".timeline").trigger("drag")
});
});