Forum Moderators: open
There is a script I have found (bug 97283) that allows a javascript to make the DIV field scroll ... I want to combine that code to work with a DIV that is already rendered in javascript.
Here is the DIV scrollfix...
<script type="text/javascript">
function fixScroll(div) {
var s = div.scrollTop;
div.childNodes[1].focus();
div.scrollTop = s;
}
</script>
DIV with JS Fix...
<div onmouseover="fixScroll(this);"></div>
Here is my code that I want to apply this JS scroll fix to and haven't gotten it to work on my end yet.
<script type="text/javascript">
<!--
function resizeDiv() {
width = document.body.clientWidth-20;if ((navigator.userAgent.indexOf("Opera 6")!=-1)
¦¦(navigator.userAgent.indexOf("Opera/6")!=-1))
{
height = document.body.clientHeight-20;
}
else if (navigator.userAgent.indexOf("Opera")!=-1)
{
height = document.body.clientHeight-40;
}
else
{
height = document.body.clientHeight-20;
}
document.getElementById('DivBody').style.width = width;
document.getElementById('DivBody').style.height = height; }
document.writeln('<div id="DivBody" class="body">')
resizeDiv();
//-->
</script>
To test the script use any stable release of 1.7.5 or older.