TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-03-2008, 08:51 AM   #1 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default Measure height of page in pixels..?

I need to measure the height of a page in pixels, and then set the height of a div to that height minus X amount of pixels... How would I do that? O.o

(height:auto; doesn't work in IE or Opera...)


Seems like a javascript kinda' thing, but javascript can get browser iffy, and I don't know JS anyway O.o.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 01-03-2008, 11:54 AM   #2 (permalink)
The Acquainted
 
sjaq's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 113
Thanks: 11
sjaq is on a distinguished road
Default

Put this in your css::
Code:
#yourdiv {
	width: expression((document.body.clientHeight-20) + 'px');
}
Replace 20 with a number of choice and #yourdiv with your selector

edit: You should've posted this in the HTML and CSS section

Last edited by sjaq : 01-03-2008 at 12:45 PM.
sjaq is offline  
Reply With Quote
Old 01-03-2008, 05:43 PM   #3 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

It isn't that advanced as well. There a LOT of resize and size measuring tools around. Most of them are Javascript based. So, simply search for "Resolution Detection Javascript" or what ever, and you should probably find what you're looking for.

Once again Aaron, I've told you before, don't bite off more than you can chew! Friendly advice non the less.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 01-03-2008, 06:42 PM   #4 (permalink)
The Acquainted
 
Join Date: Sep 2007
Location: Arizona
Posts: 114
Thanks: 10
Andrew is on a distinguished road
Default

I've never had to use expression() in my CSS before, but will it automatically update upon resizing? I understand it might not work DURING the resize, but once you finish, will it update?
Send a message via AIM to Andrew Send a message via MSN to Andrew
Andrew is offline  
Reply With Quote
Old 01-03-2008, 07:00 PM   #5 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

The expression isn't working for me... T.T

Respawn, why do you think that this is more than I can chew?
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 01-03-2008, 07:51 PM   #6 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default

The O.o makes it seemed like your completely and utterly baffled which is somethin akin to "biting off more than you chew".
TlcAndres is offline  
Reply With Quote
Old 01-03-2008, 08:23 PM   #7 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Quote:
Originally Posted by TlcAndres View Post
The O.o makes it seemed like your completely and utterly baffled which is somethin akin to "biting off more than you chew".
There's my backup on this one. It's not meant as offense, but if you had any clue what to look for, you could have found out yourself. That's the general way I learned Javascript & PHP combined.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 01-04-2008, 01:09 PM   #8 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

I made this code couple weeks ago its very simple one.

PHP Code:
<script type="text/javascript">
    
function 
overLay(){

    var 
height document.body.clientHeight;
    var 
width document.body.clientWidth;
    
    
document.getElementById("overlay").style.width width;
    
document.getElementById("overlay").style.height height;
    
document.getElementById("overlay").style.opacity 0.2;
}
    
</script> 
It will leave a gap around the page, but you can also make it so it sets the body margin to 0 so it fits plush to the sides.

Here is an example i made: HERE
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 01-04-2008, 01:13 PM   #9 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

I see one issue with that, Rendair, and that is the bottom of the scroll bar is missing on the window that pops-up after you click grow. In Firefox, anyhow.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 01-04-2008, 01:24 PM   #10 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
I see one issue with that, Rendair, and that is the bottom of the scroll bar is missing on the window that pops-up after you click grow. In Firefox, anyhow.
Indeed it does need tweaking, but that pop up is just a feature you can add the code above does not give you that, but just lets you cover the page with a div
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 01-05-2008, 01:14 AM   #11 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Aye! In that case it is very nice Excuse my finickiness!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:28 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design