jquery - Changing CSS when changing select -
this working. i'm wondering why isn't affecting css of every .container
within .filteritem
. it's finding first 1 on page whereas want to change .container
within .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 have rid of .first() call
Comments
Post a Comment