首页 > 解决方案 > 发送双击到 Internet Explorer

问题描述

我希望双击 HTML 表格行来选择记录。

我找到了发送左键的元素,但我无法发送双击。我检查了选择没有鼠标事件控件/属性,我认为这是因为它使用了 jquery / java 函数。

我无法分享网站。我知道它可以做到,因为有人有,但他们没有分享它。

我认为与我们需要的功能有关的代码

/* double click on table row */
jQuery(tableId ).on('dblclick', ' tbody tr',function() {
if(isAutoNextEnabled!=null && isAutoNextEnabled=='Y'){
createAutoNextListNew(oTable, tableName, this);
}
window[functionName](this);
});

由于我无法共享 URL,我找到了一个替代https://unixpapa.com/js/testmouse-2.html

这是一个检测我们点击的网站。它捕获单击左键,但不捕获双击。

我知道提供的网站有一个 firevent 选项,但我需要此功能的网站没有。

这适用于从网站(https://unixpapa.com/js/testmouse-2.html)单击一次,它会捕获一次左键单击:

set ta = objie.getElementsByTagName
for each x in ta
    if x = [[our target ]]
    x.click
    end if
next x

当我双击时它不起作用

for each x in ta
    if x = [[our target ]]
        x.doubleclick
    end if
next x

或者

for each x in ta
    if x = [[our target ]]
        x.doubleclick
    end if
next x

标签: jqueryexcelvbainternet-explorer-11

解决方案


你看过jquery api双击吗?

https://api.jquery.com/dblclick/

推荐阅读