🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
5 messages
5 total messages Started by Brian Wed, 08 Nov 2006 18:58
IE behaviour
#498
Author: Brian
Date: Wed, 08 Nov 2006 18:58
43 lines
2495 bytes
I hope someone here can help. I've been developing a series of 
scripts for a web page. The web page has some embedded javascript
that creates a div tag to scroll the window as well as a div tag 
that puts a footer on the absolute bottom of the window:

<SCRIPT TYPE='text/javascript'>
var winW=0,winH=0,head,foot;

if( typeof( window.innerWidth ) == 'number' ) 
{ //Non-IE
  winW= window.innerWidth;
  winH= window.innerHeight;
} 
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
{ //IE 6+ in 'standards compliant mode'
  winW= document.documentElement.clientWidth;
  winH= document.documentElement.clientHeight;
} 
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
{ //IE 4 compatible
  winW= document.body.clientWidth;
  winH= document.body.clientHeight;
}

head=winH-180;
foot=winH-20;
footW=(winW-750)/2;
if(footW<0) footW=0;

var _header="<DIV STYLE='overflow: auto; height: "+head+"px; width:100%'>";
var _footer="<DIV STYLE='position: absolute; top: "+foot+"px; left : "+footW+"px; height: 15px; align: center; width: 750px; background-color: #1174b0; color: yellow; text-align: center; font-size: 10pt'>&copy; Copyright 2006, Plano Citizens Police Academy<\/div>";
document.write(_footer);
document.write(_header);
</SCRIPT>

Everything appears 100% correct in FireFox, Opera, Safari, and
sometimes in IE. However, I have one page that creates a roster
(which is simply a table with approximately 150 rows). When
this page is generated, it sometimes appears far below the footer
instead of directly after the header.

Any ideas?
Re: IE behaviour
#503
Author: Remy Lebeau (TeamB)
Date: Wed, 08 Nov 2006 20:17
22 lines
1666 bytes
"Brian" <brian@no-spam.net> wrote in message
news:455236e2$1@newsgroups.borland.com...
>
> I hope someone here can help. I've been developing a series of
> scripts for a web page. The web page has some embedded javascript
> that creates a div tag to scroll the window as well as a div tag
> that puts a footer on the absolute bottom of the window:

Why not just use frames for that?  It is standard HTML, so every browser
will be able to support it, even when scripting is disabled.

> Everything appears 100% correct in FireFox, Opera, Safari, and
> sometimes in IE. However, I have one page that creates a roster
> (which is simply a table with approximately 150 rows). When
> this page is generated, it sometimes appears far below the footer
> instead of directly after the header.

Can you show the actual HTML for that?


Gambit
Re: IE behaviour
#502
Author: Tom
Date: Wed, 08 Nov 2006 20:23
10 lines
1287 bytes
Brian,

>> var _footer="<DIV STYLE='position: absolute; top: "+foot+"px

That right there is saying the footer will always be "foot" px from the
top irregardless of how tall/long the page actually is. You should
switch it so that it positions from the bottom or remove the absolute
positioning altogether and let the browser stack the objects on it's own.

-Tom 
Re: IE behaviour
#521
Author: Brian
Date: Thu, 09 Nov 2006 21:16
24 lines
1613 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>
>Why not just use frames for that?  It is standard HTML, so every 
>browser will be able to support it, even when scripting is 
>disabled.

Because the site is driven by a CGI script and I have found it to
be too difficult to control the proper frame information from the
script.

>Can you show the actual HTML for that?

I ended up placing the <div> tags for both the header and footer
directly in the HTML instead of adding them via javascript. Then,
I use javascript to modify the <div> tag's attributes to achieve
the proper placement and overflow height.

IE is happy with that. Of course, all the other browsers never
had a problem in the first place, but they're good with this
solution too.

Brian
Re: IE behaviour
#520
Author: Brian
Date: Thu, 09 Nov 2006 21:21
20 lines
1546 bytes
"Tom" <tom@nospam.net> wrote:
>That right there is saying the footer will always be "foot" px 
>from the top irregardless of how tall/long the page actually is. 
>You should switch it so that it positions from the bottom or 
>remove the absolute positioning altogether and let the browser 
>stack the objects on it's own.

Letting the browser stack the objects does not achieve the desired
affect. "foot" is a calculated value and does, in fact, achieve
the desired result for the footer in all browsers. I didn't even
think of positioning it from the bottom - don't even know if it
would work, but I'll try it!

Anyhow, that is not the problem, but I've solved it via another
route.

Thanks.

Brian
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads