Height adjustment on window-Scroll and Resize
HTML Div's Height adjustment is required on window-Scroll and window-Resize both.
This Div is makes the whole HTML body as Clickable (Navigate to specified URL).
I use the following code ,
Body - Onload
document.getElementById('TestDiv').style.height = document.documentElement.clientHeight;
window.onresize = resize;
window.onscroll = scroll;
function resize()
{
if (document.documentElement.scrollTop == 0)
{document.getElementById('TestDiv').style.height = (document.documentElement.clientHeight * 2.175); }
else
{document.getElementById('TestDiv').style.height = (document.documentElement.clientHeight * 5);}
}
function scroll()
{
document.getElementById('TestDiv').style.top = document.documentElement.scrollTop + "px";
}
above code does not make the whole Page background as clickable on Resize and Scroll events.
If any Idea then please give me a chance of thanks
|