Марки

[script]$(document).ready(function() { hideRedundLetterBoxes(); $('.si-letter-box').click(function() { $('.si-letter-box.active').removeClass('active'); $(this).addClass('active'); var letter = $(this).attr('data-letter'); if (letter !== 'all') { $('.si-brand-box[data-letter=\'' + letter + '\']').show(); $('.si-brand-box:not([data-letter=\'' + letter + '\'])').hide(); } else { $('.si-brand-box').show(); } }); function hideRedundLetterBoxes() { var letter, itemsFound; var lb = $('.si-letter-box'); $(lb).each(function() { letter = $(this).attr('data-letter'); itemsFound = $('.si-brand-box[data-letter=\'' + letter + '\']'); if (letter !== 'all' && itemsFound.length < 1) { $('.si-letter-box[data-letter=\'' + letter + '\']').hide(); } }); } });[/script]