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:
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
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
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
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
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:
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
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
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