Strange behaviour until page refresh

Strange behaviour until page refresh

I have a simple slider script on my webpage. The height of the open div is dynamically set by jquery- it works just fine after a page refresh, but initially, the content and layout is all crazy. I'm stumped. Any ideas would be much appreciated! I'm running a pretty recently jquery version, downloaded earlier this week, btw.