CSS Conflict
html {overflow-x:hidden;}
with
Web Browser Command
Ctrl + F or find() or keyword search
Problems:
Site is horizontal scroll design that jumps to previous(Left) or next(Right) to a predetermined width/step/section without a visible horizontal scroll bar.
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;
}
};
When I invoke a Ctrl+F to find words, the page will not follow the highlighter off screen left or right. Except when Overflow-x: visible
and that only scrolls to the word not the entire screen width/step/section that the word is in.
Overflow-x:hidden;
removes the browsers ability to scroll horizontally;Overflow-x:visible;
browsers only scrolls to word not next section when in horizontal overflow;
Can I follow the browser ctrl+f word highlighter feature at predetermined width steps/sections?
Can I invoke the key-press when ctrl+f word highlighter moves off screen?
Is it possible to capture the highlighted word coordinates( x , y)?
Functioning Test Code:
<!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>
overflow: visible
you could check if thescroll
event is triggered and then check thescrollLeft
if it has a valid value and if not correct it so that the page is fully visible. (I can't test myself right now, but this is what i would try)