SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Equal heights column script

    I would like to write my own equal height column script and think I have the right idea but am kinda lost. Can someone help me out. Help think about what I need to do here. I am trying to learn jquery.
    Here is my code so far:

    var $coldblheight = jQuery('#col_double').height();
    var $colsnglheight = jQuery('#col_single').height();

    if($coldblheight > $colsnglheight){
    (I know this is not how its done but this is the idea) return $colheights
    }else{
    (I know this is not how its done but this is the idea) return $colheights
    }

    jQuery('#col_double, #col_single').css('height', $colheights);


    I have tried many things but hitting dead ends. Maybe this is more complicated than I thought.
    What am I missing here?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by EZPA55 View Post
    I have tried many things but hitting dead ends. Maybe this is more complicated than I thought.
    What am I missing here?
    It is more complicated than you thought. It's called newspaper columns, and is supported in CSS3.
    The Future of "Newspaper" Column Style Layout with CSS 3

    There are some scripted solutions too, that you can find by searching google, but they tend to get quite complex.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •