Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript equal height columns

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28972
    iamSteve
    Member

    hello all,

    just a simple problem i’m hoping, the basics are i want equal height columns in my footer seen here: http://iamsteve.me, it’s fine on the home page, but if you go to any other page they aren’t equal i have this code

    Code:
    $(function(){ var H = 0; $(“.footer_links”).each(function(i){ var h = $(“.footer_links”).eq(i).height(); if(h > H) H = h; }); $(“.footer_links”).height(H); });

    i’m a complete beginner with jquery and i just guessed really to put all my footer_links class in each bit of the code and it worked for the homepage, just not any other page

    the site is wordpress based and i’m using the latest version of jquery

    if you need any more information i’d gladly provide it

    many thanks

    #75324
    Chris Coyier
    Keymaster

    Pop open firebug and load any page other than your homepage. There is a JS error throwing:

    $panels[0] is undefined

    The reason that equal heights code isn’t working is because it’s not running because it’s not making it that far before it errors. Gotta clear that up first.

    #75155
    iamSteve
    Member

    ah right, i noticed that error (just never thought anything of it), probably explains why a lot of my other jquery codes i’d tried putting in never worked. i’ll give it a try, thanks.

    edit: i got rid of the [0] which was in my slider.js file. it now works, my only problem being my slider scrolls vertical instead of horizontal.

    edit: used my head and looked at my code and sorted it, thanks again chris!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.