JavaScript Detect Scrollbar
-
it is possible to detect if the page has a horizontal scrollbar using javascript ??
When you get mad...THINK twice that the only advice Tamimi - Code
-
it is possible to detect if the page has a horizontal scrollbar using javascript ??
When you get mad...THINK twice that the only advice Tamimi - Code
In IE: if (document.body.clientHeight < document.body.scrollHeight) { alert("vertical scrolling"); } if (document.body.clientWidth < document.body.scrollWidth) { alert("horizontal scrolling"); } in FX: document.body.scrollTop+=10; if (document.body.scrollTop==0) alert('no vertical scroll bar'); document.body.scrollLeft+=10; if (document.body.scrollLeft==0) alert('no horizontal scroll bar');
-
In IE: if (document.body.clientHeight < document.body.scrollHeight) { alert("vertical scrolling"); } if (document.body.clientWidth < document.body.scrollWidth) { alert("horizontal scrolling"); } in FX: document.body.scrollTop+=10; if (document.body.scrollTop==0) alert('no vertical scroll bar'); document.body.scrollLeft+=10; if (document.body.scrollLeft==0) alert('no horizontal scroll bar');
thanks :cool:
When you get mad...THINK twice that the only advice Tamimi - Code