Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 9th, 2008, 07:15 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Application Window resize detection jcable Excel VBA 2 June 4th, 2008 02:48 PM
Window Resize arunmohanmp HTML Code Clinic 1 September 20th, 2006 03:27 AM
Resize and lock the Access Window dartcoach Access 5 June 23rd, 2005 10:35 AM
Application Window resize Draffus VB How-To 0 September 8th, 2004 03:49 PM
Change height of div element if < window height JoelJunstrom Javascript How-To 1 October 10th, 2003 09:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.