Я создаю поиск по ключевым словам для проекта. поэтому, чтобы убедиться, что он не учитывает регистр, я устанавливаю значение поиска и содержимое в нижний регистр, прежде чем будет выполнено сравнение. Вот где я нахожусь:
self.contentSelected = jQuery('.policies_container .lof-element .lof-inner a').html();
jQuery('.policies_container .lof-element .lof-inner a :contains("' + self.term + '")').each(function() {
jQuery(this).html(jQuery(this).html().replace(new RegExp(self.term, 'g'), '<span class="highlight">' + self.term + '</span>'));
jQuery(this)
.find('.highlight')
.fadeIn(self.fadeSpeed);
jQuery(".highlight").each(function() {
if(jQuery(this).parent().is(":hidden")) {
jQuery(this).closest(".lof-element").slideDown();
jQuery(this).closest(".lof-toggler").addClass("active_acc");
self.targetOffset = jQuery(".highlight:first-child").offset().top;
jQuery('html, body').animate({scrollTop: self.targetOffset}, self.scrollSpeed);
}
});
});
так вот вторая строка здесь
jQuery('.policies_container .lof-element .lof-inner a :contains("' + self.term + '")').each(function() {
Я ищу синтаксис, необходимый для отображения содержимого .lof-inner в нижнем регистре, в то же время применяя селектор: contains.
Любая помощь, спасибо!