Reputation: 10235
This is a very interesting problem. Basically I'm adding a few li tags dynamcially:
var fileList = $("#openWin ul");
for (var i = 0; i<20; i++){
fileList.append("<li>"+i+"<\/li>");
}
I have some css for my li tags:
li{
list-style : none;
font-size : 12px;
margin: 0;
padding : 5px 10px 5px 10px;
border-bottom : 1px solid #cccccc;
font-family : Georgia, serif;
background-color : white;
cursor : pointer;
}
This doesn't seem to work in IE6. The first few li tags don't appear to have the css fully applied to them:
Here is a link to the live file. I tried setting up a jsFiddle and jsBin for this but neither of those sites seem to function properly in ie6.
Strangely if I add some events to the li tags, the same issue arises. Adding this code:
$("#openWin li").live('mouseover', function(){
$(this).css({"background-color": "#ededed"});
}).live("mouseout", function(){
$(this).css({"background-color": "white"});
});
Works but the first few li tags act strangely. I'm going to keep working on this, any input would be greatly appreciated.
Upvotes: 0
Views: 386
Reputation: 10814
Looks like a hasLayout issue - try adding zoom:1
to your li styles. Another option is adding a space to the text you are appending as below:
fileList.append(" <li>"+i+"<\/li>");
Upvotes: 1
Reputation: 10371
@Zevan: Comment out position: relative;
in your #files
CSS. This should fix the issue.
#files {
background-color: white;
height: 450px;
margin: 10px;
overflow: auto;
/*position: relative;*/
width: 230px;
}
Upvotes: 1
Reputation: 20235
From the image it looks like the CSS works except for the border-bottom. Try:
for (var i = 0; i<20; i++){
fileList.append("<li style=\"border-bottom:1px solid #cccccc;\">"+i+"<\/li>");
}
Upvotes: 1