|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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? |
|
#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? |
|
#3
|
|||
|
|||
|
RE: CSS problems
Quote:
just check if document.getElementBzId('norm') is null or not. like so: Code:
norm = document.getElementById('norm');
if (norm) {
normHeight = norm.offsetHeight;
// ...
}
|
|
#4
|
||||
|
||||
|
RE: CSS problems
check the code dude - that's exactly what I'm doing.
|
|
#5
|
|||
|
|||
|
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?) |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > CSS problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|