View Full Version : How can I make divs appear only if the page reaches a certain height?

01-13-2012, 07:33 AM
I don't want my sidebar columns to be too long when the main content is shorter. Is there any way (javascript? jquery? something else?) to only let certain divs load when the main content reaches a certain height?

01-13-2012, 02:51 PM
yes, but as far as I am aware you need to set the height of your main content div before you can begin calculating

<div id="side" style="border-style:dashed; float:left">side
<div id="hidden" style="display:none"> hi there. I'm the hidden div!</div>
<div id="main" style="border:solid; height:100px; width: 200px; float:left">main</div>
<input type="button" value="grow div" onclick="growDiv()"/>
<script type="text/javascript">
function growDiv(){

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum