View Full Version : Dynamically adjusting div heigh with javascript.
jdl8422
Sep 24, 2008, 12:11 PM
I am currently doing a website that uses the coda slider for the main content. There are 6 or so navigation buttons on the top of the div layer. When you click on the nav, the content slides over using javascript. That part works fine. Does anyone know of a way to dynamically adjust the height of each new window that slides over. i want it to automatically adjust height based on content.
Here is an example of the coda slider: http://www.ndoherty.com/demos/coda-slider/1.1.1/
angelwatt
Sep 24, 2008, 12:47 PM
Looking at the implementation, it would be somewhat hard to do. The height of the window is based on the max height of the windows. Even though you're only viewing one window at a time, the others are still there so the CSS is accommodating them. You'd have to calculate the actual height being used by all of the content, which is doable, but can be a touch cumbersome and could be hard to integrate into the existing JavaScript code.
I'm just giving you this info so you realize it's not a simple edit.
jdl8422
Sep 24, 2008, 01:19 PM
Thats what I thought. I thought it may be easier because each window has the same class called .panel. So I was curious if I could just use a seperate class for each window so there would be different heights. I'm not a javascript expert so I'm not 100% sure if its possible. Thanks
vBulletin® v3.6.10, Copyright ©2000-2009, Jelsoft Enterprises Ltd.