私ULは5つの要素を持つ1つの要素を持っていLIます:
ul{
width: 200px;
height: 100%;
padding: 0;
margin: 0;
overflow-y: auto;
overflow-x: hidden;
list-style: none;
margin-left: 3px;
}
li{
position: relative;
height: 50px;
width: 193px;
left: 0;
right: 0;
margin: 10px 0;
cursor: pointer;
}
上LIからすべてのピクセル値を取得したいのですULが、このコードを使用すると:
$('ul li').each(function(){
console.log($(this).css('top'));
});
それは私にこれを示しているだけです: 'auto'、なぜですか?