HTML:
<ul class="listul">
<li style="width:10px; top: 0px"></li>
<li style="width:10px; top: 0px"></li>
<li style="width:10px; top: 5643px"></li>
<li style="width:10px; top: 56px"></li>
</ul>
JS:
var top = $('.listul li').css('top');
var wT = 0;
if (top = '0px'){
$(this).each(function(){
wT += $(this).outerWidth();
});
alert(wT);
}
li の幅を if(top = '0px') で合計したいのですが、うまくいきません。助けてください