This is currently working. But what I'm wondering is why this isn't affecting the CSS of every .container
within a .filteritem
. It's only finding the very first one on the page whereas I want to to change everything .container
within a .filteritem
.
$(document).ready(function () {
$('#select').on('change', function () {
if (this.value == 'alltopics') {
$('.filteritem').fadeIn(500);
} else {
var elems = $('.filteritem[data-aa_eventtopic="' + this.value + '"]');
$('.filteritem').not(elems).closest('.filteritem').fadeOut(500);
elems.closest('.filteritem').fadeIn(500);
//HERE
$('.filteritem').each(function () {
setTimeout(function () {
$('.container').filter(':visible').first().css({
borderTop: 'none',
paddingTop: '0px'});
}, 501);
});
}
});
});
I guess you just have to get rid of that .first() call