[jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Joel Noble
I've got a little code snippit that adds LI elements to an ordered list (OL). In Firefox, the added elements get their own numbers and all is good. In IE, every element is added as #1. (The LI is added, but each one shows as #1). Here's what I'm doing to add the elements:

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Klaus Hartl
Joel Noble schrieb: I've got a little code snippit that adds LI elements to an ordered list (OL). In Firefox, the added elements get their own numbers and all is good. In IE, every element is added as #1. (The LI is added, but each one shows as #1). Here's what I'm doing to add the

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Jonathan Sharp
You could also try this: $('#mylist').append('li id='+ listItemId +' value=' + ($('#mylist li').size() + 1) + '' + textToShow + '/li'); Cheers, -js On 2/6/07, Klaus Hartl [EMAIL PROTECTED] wrote: Joel Noble schrieb: I've got a little code snippit that adds LI elements to an ordered list

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Paul McLanahan
I can't reproduce the problem. I've tried a similar script in IE6 and IE7 and they both behave nicely when using append() and prepend() on an OL element. Could you post a link to a page with your full example on it, or post more code? Also, I tested with jQuery version 1.1.1, are you using an

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Joel Noble
On Tue, Feb 06, 2007 at 03:22:28PM -0500, Paul McLanahan wrote: I can't reproduce the problem. I've tried a similar script in IE6 and IE7 and they both behave nicely when using append() and prepend() on an OL element. Could you post a link to a page with your full example on it, or post more

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Briz
Hi there. I recently ran into this exact same problem and tore out what remained of my hair figuring it out. The problem is not with jQuery or JavaScript, but with IE allowing CSS to affect how it handles the numbering of ordered list items. Here's a page describing the problem:

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Briz
Kinda makes you wonder what those microsoft engineers smoke, eh? I had a complex css scenario as well, but with some significant reworking was able to make it all work. I learned some new curse words in the process, but it eventually worked. If you're stuck with hasLayout and you absolutely

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Nathan Young -X \(natyoung - Artizen at Cisco\)
They must have pulled bulets and numbering over from word :) ---N Kinda makes you wonder what those microsoft engineers smoke, eh? I had a complex css scenario as well, but with some significant reworking was able to make it all work. I learned some new curse words in the process, but

Re: [jQuery] Make IE re-number an OL after adding elements?

2007-02-06 Thread Karl Swedberg
As a last resort, you might be able to fake an ol. Let's say, for example, that you use divs instead of lis, and they'll be wrapped in div id=list/div. You could add this after the new div is appended: $('#list div').each(function(index) { $(this).prepend(index+1 + '. '); }); totally