gpt4 book ai didi

html - 在其他 iframe 中跨元素使用 accesskey 在 Chrome 中不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 13:23:22 25 4
gpt4 key购买 nike

在 chrome,我专注于“A”iframe。其他 iframe 上有元素设置的 accesskey 属性。我不能使用 accesskey 来关注元素。 IE,FF不存在这个问题。

有什么技巧可以解决这个问题吗?我的代码如下:

index.html:

<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<input type="text" accesskey="b" name="some_name" value="">
<iframe src="a.html"></iframe>
<iframe src="b.html"></iframe>
</body>

a.html:

<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<input type="text" accesskey="e" name="some_name" value="">
</body>

b.html:

<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<input type="text" accesskey="t" name="some_name" value="">
</body>

最佳答案

问题将与当前焦点正在查看的上下文有关。因此,如果用户没有在相应的 iframe 中单击,则访问 key 将不起作用。实现这一点的一种方法是触发 javascript 键事件,它将键事件转发到每个 iframe,直到它满足相应的访问键属性。

关于html - 在其他 iframe 中跨元素使用 accesskey 在 Chrome 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13271694/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com