Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HOWTO: determine lowest pixel on page

0 views
Skip to first unread message

Avi Landy

unread,
Jul 31, 2002, 10:00:55 AM7/31/02
to
We have a .Net site on which every page has a footer control. Some
pages have all their elements absolute positioned, some have all
flowing, and some have both types. We also have a sidebar containing a
menu which is the same on every page. The problem is that the footer
doesn't know where to position itself. On some pages, the Menu ends
after all the elements, and on some pages the elements end after the
menu. We wrote a script (which is becoming a monster!!) where we run
through all the elements on the page, and get the bottom pixel for
each one, and set the footer after the lowest one. But this script has
problems, and about 20% of the time, it doesn't catch the bottom
pixel. Also, it takes a very long time on some of our pages (we have
pages that have over 600 controls!!). Does anyone know of a simple way
of doing this?

Thanks,
Please reply in group,
Avi

TMRDD

unread,
Jul 31, 2002, 10:22:58 AM7/31/02
to
Understanding that I am not sure what your footer control is doing, here's where I found a solution for "always on the bottom-right": http://www.dynamicdrive.com/dynamicindex4/index.html

--

Kindest regards...
The Most Reverend Doktor Dot
For the benefit of all, please post to the newsgroup first.
-----
Sites of interest:
http://www.whatwomenreallywant.ca
http://www.dasign.ca
http://www.thedoctorofdasign.net
http://www.adumbrate.net
"Avi Landy" <ala...@hotmail.com> wrote in message news:118bf084.02073...@posting.google.com...


> We have a .Net site on which every page has a footer control. Some
> pages have all their elements absolute positioned, some have all
> flowing, and some have both types. We also have a sidebar containing a
> menu which is the same on every page. The problem is that the footer
> doesn't know where to position itself. On some pages, the Menu ends

[snip]

Doctor Unclear

unread,
Jul 31, 2002, 10:24:51 AM7/31/02
to

Hello Avi,

Try this script I wrote a few months ago:

<script type="text/javascript">
<!--
function PutDivBoxAtEndOfDocument()
{
HeightOfDocument = (document.all && document.compatMode &&
document.compatMode == "CSS1Compat") ?
document.documentElement.scrollHeight : (document.all &&
document.compatMode && document.compatMode == "BackCompat") ?
document.body.scrollHeight : document.documentElement.scrollHeight ;

document.getElementById("box").style.position = "absolute";
document.getElementById("box").style.top = HeightOfDocument -
document.getElementById("box").offsetHeight + "px";
}
-->
</script>

Just replace "box" with the id of the footer. The above code should work
under Gecko-based browser and MSIE 5+ browsers with a (full url system)
doctype. I have not tested the function with all absolutely positioned
elements but I don't see how this could effect MSIE or Gecko-based
browsers. Just come back in the thread if this script does not work.

DU

0 new messages