【发布时间】:2020-07-06 15:18:06
【问题描述】:
我希望双击 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);
});
由于无法分享网址,我找到了替代的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
【问题讨论】:
标签: jquery excel vba internet-explorer-11