0

现在我有:

$("#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
});
4

1 回答 1

0

关于什么:

$("#myElement").bind("buildTimeline", function (event, newViewObj) {
    $(this).children(".timeline").draggable({
        axis:"x",
        drag:$(this).children(".timeline").trigger("drag")
    });
});
于 2010-10-26T17:00:26.870 回答