Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 575625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:57:38+00:00 2026-05-13T13:57:38+00:00

IE6 is always surprising me but this one is REALLY odd. I’m creating a

  • 0

IE6 is always surprising me but this one is REALLY odd.

I’m creating a horizontal menu where I need the text in each ‘button’ to be vertically centered. Easy in any browser except IE. So, for IE browsers, I’m using a bit of javascript to add the necessary padding to each button to make sure the text appears centered.

I got this working just fine in IE8 and IE7. IE6 just wasn’t doing it right for some reason.

So, I added an ALERT right before the line that adds the padding:

$menuTriggerUL.children('li').each(function(i){
        var heightDifference = tallestTab-tabTextHeight[i];
        if (heightDifference < 0){heightDifference=0};
        alert(heightDifference);
        $(this).children('a:first').css("padding-top", Math.floor(heightDifference/2) );
    });

With that alert there, IE6 will one-by-one apply the correct padding to each element properly.

If I take the alert out, it fumbles and gets the first one right, but stumbles on the subsequent ones.

It seems like that jQuery is trying to go faster than IE6 can handle it. Obviously that’s likely not what’s happening, but am not sure how else to describe it.

Some things that might be part of the issue: I’m using a jQuery each() function and, within, grabbing values from a previous populated array.

Any theories as to what might be going on?

UPDATE: jhurshman’s answer below was the solution. I’d love to know more about this issue and if folks have some ideas as to which scenarios might trigger this issue for IE6. I’ve never run into it, but am glad to have a fix in the toolbag for future use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:57:39+00:00Added an answer on May 13, 2026 at 1:57 pm

    In working with IE (6 especially, but with 7 also sometimes), there are fairly frequently situations where the DOM doesn’t seem to be ready immediately after it’s been manipulated in some way. Very frequently, such issues are resolvable by deferring the problematic code by doing something like:

    setTimeout(troublesomeCode, 0);
    

    (where troublesomeCode is a reference to a function which will perform the problematic operations)

    I would also try looping over the nodes in reverse order and see if that makes any difference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.