Categories

 

 

 

Valid XHTML 1.0 Transitional

 

Valid CSS!

 

Tutorials > HTML - XHTML - JavaScript > Tutorial #182

Creating Max Sized Divs With jQuery

Level: Beginner
Requirements: None
Language: HTML, Javascript, jQuery

Introduction

Today I encountered an issue where I had to make sure a couple of div containers all had the same height, regardless of the length of content. I had seen some code that dealt with actioning each div individually but thought there had a be an easier way of doing this. So I opted to wrap up some code in a jQuery function, essentially, given a container name, the code would then look for any divs within this container and check for a certain class name, it would then work out which of these was the highest div and apply that value to the height of the other divs.

Sounded tricky, but was actually very easy to do. So lets plod on and see how we can solve this issue.

Page 1 | Page2 | Page3

Tutorial By Submitted On Views Rating
Rob Boyle 25/01/2010 779 Not Yet Rated
Rate Tutorial