CSS 冲突
html {overflow-x:hidden;}
使用
Web 浏览器命令
Ctrl + F or find() or keyword search
问题:
站点是水平滚动设计,可以跳到上一个(左)或下一个(右)到预定的宽度/步长/部分,而没有可见的水平滚动条。
document.onkeydown = function(evt) {
evt = evt || window.event;
switch (evt.keyCode) {
case 37:
leftArrowPressed();
window.location.href = '#one';
break;
case 39:
rightArrowPressed();
window.location.href = '#two';
break;
}
};
当我调用 Ctrl+F 来查找单词时,页面不会跟随荧光笔向左或向右离开屏幕。除了何时Overflow-x: visible
并且仅滚动到该单词而不是该单词所在的整个屏幕宽度/步长/部分。
Overflow-x:hidden;
删除浏览器水平滚动的能力;Overflow-x:visible;
水平溢出时浏览器只滚动到单词而不是下一部分;
我可以在预定的宽度步骤/部分遵循浏览器 ctrl+f 单词荧光笔功能吗?
当 ctrl+f 单词荧光笔移出屏幕时,我可以调用按键吗?
是否可以捕获突出显示的单词坐标(x,y)?
功能测试代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Alpha Test</title>
<style type="text/css">
* {
margin:0;
padding:0;
}
html {
height:100%;
overflow-x:hidden;
}
body {
height:100%;
}
#wrap {
min-height:100%;
width:200%;
}
#one, #two {
width:50%;
float:left;
}
</style>
<script type="text/javascript">
document.onkeydown = function(evt) {
evt = evt || window.event;
switch (evt.keyCode) {
case 37:
window.location.href = '#one';
break;
case 39:
window.location.href = '#two';
break;
}
};
</script>
</head>
<body>
<div id="wrap">
<div id="one">
<iframe id="frame" src="https://wiki.videolan.org/" frameborder="0" marginwidth="" width="100%" height="100%" align="bottom">Browser not compatible.</iframe>
<!END URL-iFrame></div>
<div id="two">
<iframe id="frame" src="http://imdb.com" frameborder="0" marginwidth="" width="100%" height="100%" align="bottom">Browser not compatible.</iframe>
<!END URL-iFrame></div>
</div>
</body>
</html>