Jump to content

adding +1 to margin until it hits bottom


Blackmajik
 Share

Recommended Posts

function fullheight() {	var bottompixels = document.getElementById('bottomnav');	for(var x = 0; x < 200; x++) {		bottompixels.style.marginTop = x+"px";	}}

this is the javascript i started but cant figure out when to break out when the div hits the bottom of the page

<div id="bottomnav"><ul id="bottomnav-list" class="clearfix">	<li><a href="test17.html">WEBSITE RESOURCES</a></li>	<li><a href="test18.html">SITEMAP</a></li></ul></div></div><div id="footer"></div></body></html>

this is the html im using and trying to do the top margin function on the div with id bottomnav. anyone have any ideas? or if a different way is better for this. i think using javascript to get the "position y" coords to check when its at the bottom but it looks like you can only get those coords in javascript if you set them in javascript so im having some trouble.

Link to comment
Share on other sites

Here is the html page im doing this on: http://beyondmeta.net/wordpress/ I want it to look like this one: http://beyondmeta.net/BeyondMeta/ <----homepageany other ideas on how to make the footer always go to the bottom of the page? If theres enough content to fill the page it will fit snug and perfect on the bottom like homepage but if there is not enough like a short blog post it has a huuuuge gap at the bottom between footer and bottom of browser. Think i know one way to fix but itll take almost an entire recode of xhtml/css on the layout. any suggestions?

Edited by Blackmajik
Link to comment
Share on other sites

why not use min-height: using this will force it to be a set height (except in ie6), until content goes beyond this height.
dont think that would work since ppl have different screen sizes footer would not rest at 0px bottom on all people browsers
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...