Jonas Eriksson
11/08/2022, 9:53 AMfunction countEurobat10items() {
var eurobat10counterX = Array.from(containermixitup.querySelectorAll('.LongLife'));
console.log(eurobat10counterX.length); // example: 35 total in DOM, 15 have "display:none" -> I want this number to be 20
eurobat10counter = eurobat10counterX.length;
// set this counter value into a span ID in the filter box
$('#eurobat10counter').html(eurobat10counter);
// change the className of the filter row, i.e. if we filter on one kind, we fade the others
if ( eurobat10counter < 1 )
{
document.getElementById("eurobat10Label").className = "configuratorOptionItemSmallDisabled";
document.getElementById("eurobat10counter").className = "configuratorOptionCounterDisabled";
}
else {
document.getElementById("eurobat10Label").className = "configuratorOptionItemSmall";
document.getElementById("eurobat10counter").className = "configuratorOptionCounter";
} ;
}
Jonas Eriksson
11/08/2022, 1:19 PMlet visibleEurobat12 =$(".VeryLong:visible");
seems to do what I need.salted
12/01/2022, 6:26 PMsalted
12/01/2022, 6:26 PMsalted
12/01/2022, 6:28 PMcontainermixitup.querySelectorAll('.LongLife').filter(function(el){
var style = window.getComputedStyle(el);
return (style.display !== 'none')});
salted
12/01/2022, 6:29 PMcontainermixitup.querySelectorAll('.LongLife').filter(function(el){
return $(el).is(":visible");
});
salted
12/01/2022, 6:31 PMcontainermixitup.querySelectorAll('.LongLife').filter(function(el){
return $(el).is(":visible");
});
or
$(containermixitup).find(".LongLife").is(":visible");
Jonas Eriksson
01/19/2023, 2:24 PM