I think I have sorted the problem
if (document.getElementById('divID').scrollHeight >
document.getElementById('divID').clientHeight) ....
can anyone see any problems with this?
The below code fails to detect a horizontal scroll bar on Firefox
<div id=div1 style="border:1px solid
red;width:120px;height:50px;overflow:auto">
There_once_was_a_boy_from_nod_Who_carried_a_lot_of_sod</div><br>
<div id=div2 style="border:1px solid
red;width:120px;height:50px;overflow:auto">
There once was a boy from nod Who carried a lot of sod</div>
<script type='text/javascript'>
function scrollDetect(elemId) {
var elem = document.getElementById(elemId);
if (elem.scrollHeight > elem.clientHeight) {
alert("code says scroll bar is present on '" +
elemId + "'\n" + elem.scrollHeight +
", " + elem.clientHeight);
} else {
alert("No scroll bar detected for '" +
elemId + "'\n" + elem.scrollHeight +
", " + elem.clientHeight);
}
}
scrollDetect('div1');
scrollDetect('div2');
</script>
Csaba Gabor from Vienna