웹 브라우저에서 클라이언트보기의 맨 아래에 막대를 붙일 필요가 있습니다. 전통적으로 나는 position : fixed를 사용할 것이다. 단, IE 6 클라이언트를 지원해야합니다. 페이지 하단과 내용 위에 막대를 붙이기 위해 매우 광범위한 해킹이 있었지만 사용자가 아래로 또는 오른쪽으로 스크롤하면 막대가 페이지에 고정되어 있습니다.IE 6,7,8에서 페이지 하단에 막대를 유지하려면 어떻게해야합니까? IE가 인터페이스를 다시 그리도록 강요하는 방법은 무엇입니까?
이 문제를 해결하려면 setInterval을 사용하여 실행되는 자바 스크립트 이벤트를 사용하고 IE (8)의 디버그 도구에서 함수를 실행할 때 이벤트가 발생하고 위치가 왼쪽 위와 왼쪽 위 속성을 변경하지만 페이지는 변경되지 않습니다. 요소를 다시 그립니다. 코드는 작동하지만 요소는 움직이지 않습니다 (아래 참조). 당신은 수정이 IE에서 작동하는 그냥 알다시피
은 다른 IE 버전이 표준을 사용하려고하는 경우가 작동하지 않을 수 있습니다 ... 모드를 쿼크. 저를 믿으십시오, 나는 시도했다.
P. 이것은 IE9 지원을 이중으로 확인하기 때문에 실제로 악화되고 있습니다 ... IE6, 7 및 8에서는 스크롤 막대와 함께 이동하지 않지만 IE 9에서는 이동하지만 IE의 경우에도 여전히 그렇습니다. " 그리고 마이크로 소프트는이 릴리스 아무것도에 영향을 ...하지 않을 것이라고 말했다
HTML 구조
<body>
<div id="j_zoom_area" style="zoom:100%;">
The Application area the the zoom is changed (by the bar) for accessibility...
</div>
<div id="j_protectorite">
<div class="j_bar">
<div class="j_plate">Zoom Controls, Help, Search, other misc controls</div>
<div class="j_plate">Copyright info, privacy policy, etc...</div>
</div>
</div>
<script type="text/javascript" language="javascript">
j_doBar();
</script>
</body>
바의 CSS는 https://kscserver.com/ERP-API/Style/includes.css입니다. 바 수정을위한 특정 자바 스크립트입니다.
//This controls the scrolling of the bar
function j_FixBarSlowly(){
var nTop = 0;
var nLeft = 0;
nTop = (document.body.scrollTop + document.body.clientHeight) - 67;
nLeft = document.body.scrollLeft;
//document.title = document.body.scrollTop + '+' + document.body.clientHeight + '-67' + '=' + nTop + 'px';
document.getElementById("j_protectorite").style.Top = nTop + 'px';
document.getElementById("j_protectorite").style.Left = nLeft + 'px';
document.getElementById("j_protectorite").style.Bottom = '';
document.getElementById("j_protectorite").style.Position = 'absolute';
//Ie6,7,8 hack to force redraw
}
function j_doBar() {
//j_FixBarSlowly();
//if (setInterval != undefined) {
// setTimeout("j_doBar();",5);
//} else {
setInterval("j_FixBarSlowly();",5);
//}
}
, 당신은 아마'추가해야 '페이지의 상단에 (당신은 문서 타입을 가지고하지 않은 경우, 그것은 의심 할 여지가 없다 브라우저 호환성 문제가 있음). – Spudley
내 개인 즐겨 찾기 : Un-IE6 그들 : http://ie6update.com/ 사악한 천재! – bpeterson76