Computing.Net > Forums > Web Development > Update DIV height - javascript

Update DIV height - javascript

Reply to Message Icon

Original Message
Name: cssExp
Date: June 17, 2007 at 23:26:50 Pacific
Subject: Update DIV height - javascript
OS: Windows Xp
CPU/Ram: Intel Celron D
Comment:

hello,

I have a fav.css file with class .favBg

CSS
-------------
.favBg
{
border: 0px;
padding: 0px;
margin: 0px;
width: 100%;
position: absolute;
background-color: #000000;
opacity: 0.5;
filter: Alpha(opacity:50);
}

Here i have made a javascript that calculates both window height and scroll height, and another function which adds both the window height and scroll height, so i got total page height.

javascript
----------
function pHeight()
{
var pHeight = scrollHeight() + windowHeight();
return pHeight;
}

what I want to do is to update the height of class .favBg with the value of pHeight(), as each page in the site are of different length. Yes, i'm trying to do 100% page height faded background, Just like in Sitepoint Marketplace's "My Shortlist".

Basically I'm doing a "My Favorites" list just like Sitepoint Marketplace's "My Shortlist".

Help greatly appreciated.


Report Offensive Message For Removal

Response Number 1
Name: Razor2.3
Date: June 18, 2007 at 00:29:51 Pacific
Subject: Update DIV height - javascript
Reply: (edit)

And aside from the code only working in IE, what's your problem?


Report Offensive Follow Up For Removal

Response Number 2
Name: cssExp
Date: June 18, 2007 at 02:36:35 Pacific
Subject: Update DIV height - javascript
Reply: (edit)

umm what i have so far works on all browsers, i guess you missed my question.


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: June 18, 2007 at 02:50:46 Pacific
Subject: Update DIV height - javascript
Reply: (edit)

Which is why I asked what your problem was.


Report Offensive Follow Up For Removal

Response Number 4
Name: cssExp
Date: June 18, 2007 at 03:56:37 Pacific
Subject: Update DIV height - javascript
Reply: (edit)

if you read my question throughly you'd understand what i was asking, as it can't be explained any simpler.

anyway i figured out a way to get the result I'm after.

Thanks. :)


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Update DIV height - javascript

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software