SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 2nd, 2004, 03:07 AM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
CSS problems

I have a css container "container" within that - on some pages only - I have a "norm" container. The problem is sometimes the "norm" sheet data that is too long of the "container" sheet and so it flows over the footer.

I'm using the "list apart" footer hack to fix the problem and it works on pages that don't have the "norm" sheet.

What I need is to edit this code :

Code:

function setFooter() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentHeight = document.getElementById('container').offsetHeight;  
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						 footerElement.style.top=(windowHeight-(contentHeight+footerHeight))+'px';
						}
						else {
							footerElement.style.position='static';
						}
				}
			}
		}


to test the "norm" sheet height - easy to do , just add this :
var normheight = document.getElementById('norm').offsetHeight;
etc ..

but if the "norm" sheet does not exist on the page then IE errors. How can I test if the norm sheet exists or not ? I think I need something like (isobject)?

Any hints?

Reply With Quote
  #2  
Old March 2nd, 2004, 05:15 AM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
RE: CSS problems

Update :

Works on all pages apart from those with tables:

Code:

function setFooter() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					if (document.getElementById('norm')) {
						var cHeight = document.getElementById('norm').offsetHeight;
					} else {
						var cHeight = document.getElementById('container').offsetHeight;  
					}	
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (cHeight + footerHeight) >= 0) {
						footerElement.style.top = (windowHeight - (cHeight+footerHeight)) + 'px';
					}
					else {
						footerElement.style.position = 'static';
					}
				}
			}
		}


It appears that it does not detect the lenght of the tables?

Any ideas?

Reply With Quote
  #3  
Old March 2nd, 2004, 06:16 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: CSS problems

Quote:
to test the "norm" sheet height - easy to do , just add this :
var normheight = document.getElementById('norm').offsetHeight;
etc ..

but if the "norm" sheet does not exist on the page then IE errors. How can I test if the norm sheet exists or not ? I think I need something like (isobject)?


just check if document.getElementBzId('norm') is null or not. like so:

Code:
norm = document.getElementById('norm');
if (norm) {
    normHeight = norm.offsetHeight;
    // ...
}

Reply With Quote
  #4  
Old March 2nd, 2004, 06:57 AM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
RE: CSS problems

check the code dude - that's exactly what I'm doing.


Reply With Quote
  #5  
Old March 2nd, 2004, 09:04 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: CSS problems

what's the problem than? that should work if there is no 'norm' element..

and about divs and tables problems, that is why i never like to mix them.. ;)

btw, could you post your css. did you positione the table in some special way? (did you set the position: css property for the table? and to what?)

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > CSS problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Try It Free




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway