请考虑具有以下代码的页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
.steal-focus { overflow-y: scroll }
</style>
</head>
<body>
<form action="/">
<input type="text" value="First">
<div class="steal-focus">Content</div>
<input type="text" value="Second">
</form>
</body>
</html>
-
-
-
第二次点击标签:焦点转到
<div>
而不是第二个文本字段,因为
overflow-y: scroll
.
这种行为是Firefox独有的:在IE、Safari或Chrome上都不会发生。我怎么才能避免这种行为,这听起来像一个Firefox的错误呢?我想把帐单跳过
<部门>
即使它有一个
overflow-y:滚动