i have some list, sometimes this lis have 5, sometimes have 7 elements. I want to check how many, and add for less than 5 some style. Si i have this, but it’s not working… Maybe i need to add some live checking? Also i’v set time interval for some kind of late chacking. Thx, for help.
setTimeout(function(){
var single_producer_products_list = $('.single_producer_products_list').find('li');
if ((single_producer_products_list < 7)) {
$('.producer_series_info').addClass('longer');
}
},200)
You can use
lengthproperty: