Rewriting CSS height attribute w/Javascript or PHP...

Discussion in 'Programming' started by starke, Sep 11, 2006.

  1. #1
    I have a profile section on a site that I'm working on, and I create 2 columns in CSS... one, the main content, the other , a navigational column.

    I've corrected the column heights to always have a min width, but when people create a larger profile, naturally, the navigational column doesn't expand past it's height setting to the larger height of the content cell. Example:
    http://www.1031store.com/experts/profile51.html

    I was wondering if there is a way in either PHP or Javascript for me to "read" the actual height attribute of the content cell (as it expands), and re-writing the height attribute of the navigational column.
     
    starke, Sep 11, 2006 IP
  2. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #2
    It's impossible to do it in PHP. Javascript solution.

    
    document.getElementById('menu_nav2').style.height = document.getElementById('content').offsetHeight + "px";
    
    Code (markup):
    You could also do it with CSS but you'd have to change your HTML and add an extra DIV tag.
     
    SoKickIt, Sep 11, 2006 IP
  3. starke

    starke Active Member

    Messages:
    228
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Thanks SoKickIt, I'll try this a little later today...
     
    starke, Sep 11, 2006 IP
  4. starke

    starke Active Member

    Messages:
    228
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Worked well so kicked it... changed it up a little (to subtract the borders out of the height... overall, great fix...

    Thank you for your help. :)
     
    starke, Sep 17, 2006 IP