0

这可以很好地确定究竟点击了什么,但前提是它是由两个实例之一,用户或代码。

$('#this').on('click', function (event) {
    if (event.originalEvent === undefined) {
        var url = this url;  
    } else {
        var url = that url; 
    }
})

有没有办法从 .trigger() 以这种格式将数据传递给事件对象以确定究竟点击了什么?所以我可以重新运行原始点击功能,但传递不同的变量,比如......

$('#this').on('click', function (event) {
    if (event.originalEvent === undefined) {
        var url = this url;
    } else if (prev was clicked) {
        var url = that url;
    } else if (next was clicked) {
        var url = theother url;
    }

    switch(url)
})
4

0 回答 0