Jul 17 2008

IE7, dropdowns, and z-index

Tag: CSS, codejeremiah @ 10:18 am

I spent most of yesterday and most of this morning battling with a IE7 display bug.

Back story: we are using jQuery’s superfish drop down menus (a jQuery based implement of suckerfish/son of suckerfish) for site navigation. Everything works great in Firefox 2/3 and Safari. I’m going to assume that IE6 looks great as well since suckerfish is known to work well in IE6.

IE7 is a different story.

There is a large image directly beneath the navigation menu. Unfortunately for me, in IE7 the menu was being rendered beneath the image, despite having a z-index of 1001.

After some careful (and careless) digging and googling, I came across a solution.

To summarize, IE7 will not render the menu with the appropriate z-index unless that z-index is present on the top level :hover style. To clarify:


/*** ESSENTIAL STYLES ***/
.sf-menu, .sf-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.sf-menu {
line-height: 1.0;
}
.sf-menu ul {
position: absolute;
top: -999em;
}
.sf-menu li:hover {
z-index: 100; /* This is the important style directive, without it IE7 chokes */
}
.sf-menu * li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
font-weight: bold;
}

IE7 Suckerfish Hover CSS


Jul 05 2008

Software Development Meme

Tag: code, nonsensejeremiah @ 9:49 pm

Rick, I’m stealing your post. Which is okay because you stole it first.

How old were you when you started programming?
I originally started learning BASIC when I was very young, probably 11 or so. I gave up on programming for more worldly pursuits, only to come back to it 10 years later.

How did you get started in programming?
The second time around I wanted to create a ‘blog’, although at the time I don’t think we called them blogs. I think we called them e/n sites (everything/nothing). So I taught myself HTML.

What was your first language?
HTML, CSS, and Perl. It was a triple whammy.

What was the first real program you wrote?
The first real business program I wrote was a socket server written in PERL that accepted a rudimentary home grown protocol. It was used to remotely monitor the health of 8 different servers. What can I say, I started out as an HP-UX sysadmin.

What languages have you used since you started programming?
HTML, CSS, JavaScript, C#, VB.NET, ASP.NET, PERL, Python, Ruby, SQL (T-SQL, PL/SQL, PL/PGSQL), PowerShell, BASH scripts, SVG, XPath, XQuery, XSLT, ActionScript. Jack of all trades, master of none.

What was your first professional programming gig?
I worked at Qwest Communications writing unimpressive PERL scripts to automate keeping an Actuate Reporting Server running without too many memory leaks. I graduated to doing the same thing for Local Number Portability software. If you don’t know what LNP is, just think of it this way: it’s the reason your calls go through and the reason you can change carriers and keep the same number.

If you knew then what you know now, would you have started programming?
I might have kept with it when I was younger. Although, frankly, I think a good part of my approach and expertise come from my lack of formal training and my background in the Humanities. Getting a four year degree in CS would have probably proved impossible for me. However, that BA in English has taught me a great deal about the importance of communication, documentation, and solid presentational skills.

If there is one thing you learned along the way that you would tell new developers, what would it be?
Communication is key. This stretches across every aspect of what we do on a daily basis. If you can’t communicate your ideas clearly and succinctly, the boss is never going to push for your pet project. If you can’t describe a problem well to non-technical people, they will never understand the importance of the issue. If you can’t share your failures and successes with fellow developers, someone will end up repeating your mistakes. Communicating is how we all learn. If people didn’t feel the urge to share their knowledge and write books, we would still be building Altair clones in our basements from Radio Shack kits.

What’s the most fun you’ve ever had … programming?
Frankly, every day is fun. I get to share knowledge with some exceptionally talented developers and I’m always learning from them. The best times are when I get to work with a dynamic team of people and build on each others ideas to make the best software we can.