Forums

Give help. Get help.

  • TWG
    # October 4, 2012 at 10:02 am

    I have a small script that runs and makes sure that two of my divs are the same height and if not, then gives them the same height.

    I’m trying to find a way to modify it to work with my Foundation3 layout. Once the scree is resized to a certain width or it’s viewed from a mobile device, i need the two divs to just take on their auto height.

    This is the code that I currently have.

    var maxHeight = 0;
    $(‘div.jHeight’).each(function() {
    if (maxHeight < $(this).height()) {maxHeight = $(this).height()}
    if (maxHeight < $('#content-section').height()) { maxHeight = $('#content-section').height()}
    });
    $(‘div.jHeight’).each(function(){
    $(this).Height(“maxHeight”);
    });

    # October 5, 2012 at 8:54 am

    Hi Maddtechwf!

    I really like the [jQuery .map() example](http://api.jquery.com/map/#example-2). But if you need a bit more functionality, check out the [Equalizer](https://github.com/CSS-Tricks/Equalizer) plugin.

    # October 14, 2012 at 8:31 pm

    If one div takes prescendence over the other then JS is your solution, but for mobile couldn’t you target a mobile.css and have the widths to auto? Mobile detection would be pretty good as well? Lookup some HTML5 boilerplates and a document inspector like modernizr

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag