jQuery Search Page Filter – display only h4 headings that contain matching content and return 'no match' when no matches are found

huangapple go评论69阅读模式
英文:

jQuery Search Page Filter - display only h4 headings that contain matching content and return 'no match' when no matches are found

问题

以下是您提供的内容的中文翻译部分:

根据另一篇帖子,链接在这里:https://stackoverflow.com/questions/76211808/jquery-search-page-filter-add-condition-that-displays-no-match-when-no-match

以下的函数在页面搜索时显示所有h4标题。内容与搜索词匹配的h4标题在标题下显示匹配的结果,而内容没有匹配的h4标题在标题下显示'无结果'。

Fiddle链接:https://jsfiddle.net/mfen723/7kqh6uwb/16/

$(document).ready(function () {
    $("#searchInput").on("keyup", function () {
      var value = $(this).val().toLowerCase();
      $("#research > :not(h4)").each(function () {
        $(this).toggle(
          $(this).text().toLowerCase().indexOf(value) > -1
        );
      });
      $("#research h4").each(function () {
        $(this)
          .nextAll(".noresults")
          .first()
          .toggle(
            $(this).nextUntil("h4").filter("p:visible").length == 0
          );
      });
    });
  });

与其在页面搜索时显示所有h4标题,我希望该函数仅显示匹配的h4标题(以及p标签内的匹配内容),并仅在页面上没有匹配项时显示'无结果'。

任何帮助都将不胜感激。

英文:

Following on from another post, here: https://stackoverflow.com/questions/76211808/jquery-search-page-filter-add-condition-that-displays-no-match-when-no-match

The function below shows all of the h4 headings on the page when the page is searched. h4s with content that match the search term show the matching results beneath the heading, and h4s with no matching content show 'no results' beneath the heading.

Fiddle here: https://jsfiddle.net/mfen723/7kqh6uwb/16/

  $(document).ready(function () {
        $("#searchInput").on("keyup", function () {
          var value = $(this).val().toLowerCase();
          $("#research > :not(h4)").each(function () {
            $(this).toggle(
              $(this).text().toLowerCase().indexOf(value) > -1
            );
          });
          $("#research h4").each(function () {
            $(this)
              .nextAll(".noresults")
              .first()
              .toggle(
                $(this).nextUntil("h4").filter("p:visible").length == 0
              );
          });
        });
      });

Instead of showing all of the h4 headings when the page is searched, I want the function to show only the h4 headings that match (along with the matching content within the p tags) and to show 'no results' only when there are no matches on the page.

Any help much appreciated.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

$(document).ready(function () {
  $(&quot;#searchInput&quot;).on(&quot;keyup&quot;, function () {
    var value = $(this).val().toLowerCase();
    $(&quot;#research &gt; :not(h4)&quot;).each(function () {
      $(this).toggle(
        $(this).text().toLowerCase().indexOf(value) &gt; -1
      );
    });
    $(&quot;#research h4&quot;).each(function () {
      $(this)
        .nextAll(&quot;.noresults&quot;)
        .first()
        .toggle(
        $(this).nextUntil(&quot;h4&quot;).filter(&quot;p:visible&quot;).length == 0
      );
    });
  });
});

<!-- language: lang-css -->

.search {
  display: block !important;
  position: relative;
  background-color: var(--bg-light);
}

.search input {
  text-indent: 25px;
}

.search input:focus {
  box-shadow: none;
  border: 2px solid var(grey);
}

.search input.form-control {
  display: block !important;
  width: 700px !important;
}

.search .fa-search {
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 2rem;
  z-index: 12;
}

/* Hide nor results div */

h4 ~ div.noresults {
	margin-bottom: 2em;
	font-style: italic;
	display: none;
}

<!-- language: lang-html -->

&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;section class=&quot;search&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;col-lg-9 mx-auto&quot; id=&quot;research&quot;&gt;
&lt;div class=&quot;search my-4&quot;&gt;
&lt;input type=&quot;text&quot; class=&quot;form-control mx-auto&quot; id=&quot;searchInput&quot; placeholder=&quot;Search resources&quot;&gt;
&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources pb-3&quot; id=&quot;#methodologies&quot;&gt;Research&lt;/h4&gt;
&lt;p&gt;Ricardo R Bartelme, &lt;a href=&quot;https://journals.sagepub.com/doi/10.1177/2164956120973634&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;Anthroposophic Medicine: A Short Monograph and Narrative Review—Foundations, Essential Characteristics, Scientific Basis, Safety, Effectiveness and Misconceptions&lt;/a&gt;, published 29 December 2020 in Pub Med, doi 10.1177/2164956120973634&lt;/p&gt;
&lt;p&gt;Mehl A, Brauer D, Didwiszus A, Gelin-Kr&#246;z B, Pranga D, Zerm R, Gutenbrunner C (2020), &lt;a href=&quot;https://www.sciencedirect.com/science/article/abs/pii/S155083072030224X&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;The Anthroposophic Art Therapy Assessment Paint (AART-ASSESS-P): A peer-report instrument to assess patients’ pictorial expression during Anthroposophic Painting Therapy&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lees J (2001) &lt;a href=&quot;https://www.researchgate.net/publication/238318617_Reflexive_action_research_Developing_knowledge_through_practice&quot;&gt;Reflexive Action Research: Developing Knowledge Through Practice: Counselling and Psychotherapy Research&lt;/a&gt; (2001), August 2001, Counselling and Psychotherapy Research 1(2):132-138, &lt;a href=&quot;https://onlinelibrary.wiley.com/doi/abs/10.1080/14733140112331385178&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;DOI:10.1080/14733140112331385178&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Shlonsky A and Gobbs L, &lt;a href=&quot;https://www.researchgate.net/publication/247903648_Will_the_Real_Evidence-Based_Practice_Please_Stand_Up_Teaching_the_Process_of_Evidence-Based_Practice_to_the_Helping_Professions&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;Will the Real Evidence-Based Practice Please Stand Up? Teaching the Process of Evidence-based Practice to the Helping Professions. Brief Treatment and Criss Intervention.&lt;/a&gt; Vol 4. No. 2., January 2004, Brief Treatment and Crisis Intervention 4(2):137-153, &lt;a href=&quot;http://mr.crossref.org/iPage?doi=10.1093%2Fbrief-treatment%2Fmhh011&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;DOI:10.1093/brief-treatment/mhh011&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kienle G S, Albonico H U, Baars E, Hamre H J, Zimmermann P, Kiene H (2013). &lt;a href=&quot;https://www.hsleiden.nl/binaries/content/assets/hsl/lectoraten/antroposofische-gezondheidszorg/artikelgaiham.pdf&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;(pdf, 882 KB )Anthroposophic Medicine: An Integrative Medical System Originating in Europe. ( pdf, 882 KB )&lt;/a&gt; Global Advances In Health And Medicine November 2013, Volume 2, Number 6&lt;/p&gt;
&lt;p&gt;Abbing A, Ponstein A, Kienle G, Gruber H, Baars E (2016) The CARE-AAT Guideline: &lt;a href=&quot;https://www.tandfonline.com/doi/pdf/10.1080/17454832.2016.1170054?needAccess=true&quot;&gt;Development and testing of a consensus-based guideline for case reports in anthroposophic art therapy.&lt;/a&gt;&lt;a href=&quot;https://www.tandfonline.com/doi/pdf/10.1080/17454832.2016.1170054?needAccess=true&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;International Journal of Art Therapy, DOI: 10.1080/17454832.2016.1170054&lt;/a&gt;&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources pt-3&quot; id=&quot;pregnancy&quot;&gt;Pregnancy, Birth and Early childhood&lt;/h4&gt;
&lt;p&gt;Gollmer B (15.01.2019) &lt;a href=&quot;https://www.anthromedics.org/PRA-0779-EN&quot; target=&quot;_blank&quot;&gt;Painting Therapy in Pregnancy and Preparation for Childbirth&lt;/a&gt; (professional information)&lt;/p&gt;
&lt;p&gt;Gollmer B (19.07.2019) &lt;a href=&quot;https://www.anthromedics.org/PRA-0781-EN&quot; target=&quot;_blank&quot;&gt;Painting Therapy in Pregnancy and Birth Preparation&lt;/a&gt; (parent information)&lt;/p&gt;
&lt;p&gt;Bissegger M (07.06.2019) &lt;a href=&quot;https://www.anthromedics.org/PRA-0805-EN&quot; target=&quot;_blank&quot;&gt;Music Therapy for Premature Infants and their Mothers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bissegger M (02.01.2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0907-EN&quot; target=&quot;_blank&quot;&gt;Music Therapy for Babies and Toddlers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bissegger M (02.01.2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0905-EN&quot; target=&quot;_blank&quot;&gt;Singing and Music for Babies and Toddlers&lt;/a&gt; (parent information) ​&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources&quot; id=&quot;child-health&quot;&gt;Child Health&lt;/h4&gt;
&lt;p&gt;Hamre HJ et al. (2009) &lt;a href=&quot;https://www.researchgate.net/publication/26309949_Anthroposophic_therapy_for_children_with_chronic_disease_A_two-year_prospective_cohort_study_in_routine_outpatient_settings&quot; target=&quot;_blank&quot;&gt;Anthroposophic therapy for children with chronic disease: a two-year Prospective Cohort Study in Routine Outpatient Settings&lt;/a&gt;. BMC Pediatr 2009; 9:39. DOI 10.1186/1471-2431-9-39&lt;/p&gt;
&lt;p&gt;Abbing A, Krantz B, Simon E, Heynen E, De Witte M and Van Hooren S (2020). &lt;a href=&quot;https://www.crd.york.ac.uk/prospero/display_record.php?ID=CRD42020162709&quot; target=&quot;_blank&quot;&gt;Effectiveness of Music Therapy Interventions in Reducing Behavioural and Emotional Problems Among Children&lt;/a&gt;. PROSPERO 2020. CRD42020162709&lt;/p&gt;
&lt;p&gt;Baars E W, Koster E B, Schoorel E P (2012).&lt;a href=&quot;https://www.researchgate.net/publication/282149760_Client_experiences_with_an_integrated_conventional_and_anthroposophic_approach_at_the_Kindertherapeuticum_in_Zeist&quot; target=&quot;_blank&quot;&gt;Client experiences with an integrated conventional and anthroposophic approach at the Kindertherapeuticum in Zeist&lt;/a&gt;. Der Merkurstab, 4:335-338&lt;/p&gt;
&lt;p&gt;Niemeijer M H, Baars E W, Hoekman J, Ruijssenaars A J J M (2018) &lt;a href=&quot;https://www.researchgate.net/publication/330164731_An_Instrument_for_Dimensional_Diagnosis_of_a_Child_Constitution_ICC_Individualizing_the_Care_for_Children_with_Developmental_Disorders&quot; target=&quot;_blank&quot;&gt;An instrument for dimensional diagnosis of a child’s constitution (ICC)&lt;/a&gt;. International Journal of Complementary &amp; Alternative Medicine, Issue 2-2018.&lt;/p&gt;
&lt;p&gt;Niemeijer M H, Baars E W, Hoekman J, and Ruijssenaars A J J M (2018). &lt;a href=&quot;https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjournal.julypress.com%2Findex.php%2Fijsn%2Farticle%2Fdownload%2F531%2F401&amp;data=04%7C01%7Cbaars.e%40hsleiden.nl%7C806fd3cb33754902a30908d92b842ba7%7C850f9344e078467e9c5e84d82f208ac7%7C1%7C0%7C637588668989923315%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=RinbscVUm36ksES%2F4dpv3pCSyMP6bzjQFJ8WPTt0yBM%3D&amp;reserved=0&quot; target=&quot;_blank&quot;&gt;Validity and Reliability of the Instrument for Assessing the Child’s Constitution (ICC): Individualising Processes in Diagnosing Children With a Developmental Disorder&lt;/a&gt; . International Journal of Studies in Nursing, 3(3), 172.&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources&quot; id=&quot;infectious&quot;&gt;Infectious and chronic diseases&lt;/h4&gt;
&lt;p&gt;Hamre H J. Witt C M, Glockmann A, Ziegler R (July 2007) &lt;a href=&quot;https://www.researchgate.net/publication/6158737_Anthroposophic_Art_Therapy_in_Chronic_Disease_A_Four-Year_Prospective_Cohort_Study&quot; target=&quot;_blank&quot;&gt;Anthroposophic Art Therapy in Chronic Disease: A Four-Year Prospective Cohort Study&lt;/a&gt; The Journal of Science and Healing 3(4):365-71, Doi: 10.1016/j.explore.2007.04.008,&lt;/p&gt;
&lt;p&gt;Hamre H J et al. (2004). &lt;a href=&quot;https://www.researchgate.net/publication/8374153_Anthroposophic_therapies_in_chronic_disease_The_Anthroposophic_Medicine_Outcomes_Study_AMOS&quot; target=&quot;_blank&quot;&gt;Anthroposophic therapies in chronic disease: The Anthroposophic Medicine Outcomes Study (AMOS)&lt;/a&gt;. European Journal of Medical Research 2004; 9:351-360&lt;/p&gt;
&lt;p&gt;Hamre H J et al. (2007) &lt;a href=&quot;https://www.researchgate.net/publication/6158737_Anthroposophic_Art_Therapy_in_Chronic_Disease_A_Four-Year_Prospective_Cohort_Study&quot; target=&quot;_blank&quot;&gt;Anthroposophic Art Therapy in Chronic Disease: a four-year prospective cohort study&lt;/a&gt;. Explore (NY). 2007 Nov-Dec;3(6):553&lt;/p&gt;
&lt;p&gt;Hamre HJ et al. (2013). &lt;a href=&quot;https://www.researchgate.net/publication/249318203_Long-term_outcomes_of_anthroposophic_treatment_for_chronic_disease_A_four-year_follow-up_analysis_of_1510_patients_from_a_prospective_observational_study_in_routine_outpatient_settings&quot; target=&quot;_blank&quot;&gt;Long-term Outcomes of Anthroposophic Treatment for Chronic Disease: A four-year follow-up Analysis of 1510 Patients from a Prospective Observational Study in routine outpatient settings&lt;/a&gt; BMC Research Notes. 2013;6(1):269. DOI: &lt;a href=&quot;https://doi.org/10.1186/1756-0500-6-269&quot; target=&quot;_blank&quot;&gt;https://doi.org/10.1186/1756-0500-6-269&lt;/a&gt;&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources&quot; id=&quot;covid&quot;&gt;COVID-19&lt;/h4&gt;
&lt;p&gt;Martin D, Soldner G (2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0971-EN&quot; target=&quot;_blank&quot;&gt;A synthesis review of current status and proposal of a registry study to overcome social polarization tendencies and answer open research questions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Soldner G, Breitkreuz T (2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0939-EN&quot; target=&quot;_blank&quot;&gt;COVID-19&lt;/a&gt; &lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;

<!-- end snippet -->

答案1

得分: 1

这是您提供的HTML代码的翻译部分:

$(document).ready(function () {
  $("#searchInput").on("keyup", function () {
    const value = $(this).val().toLowerCase();
    $('#research .noresults, #research h4 , #research p').css('display' , 'none');
    const filter_p = $("#research p").filter(function () {
        return ($(this).text().toLowerCase()).indexOf(value) > -1;
    });
    filter_p
      .css('display' , 'block')
      .prevUntil('h4')
      .prev('h4')
      .css('display' , 'block');
    $('#research h4')
      .not(filter_p.prevUntil('h4').prev('h4'))
      .nextUntil('.noresults')
      .next('.noresults')
      .css('display' , 'block');
  });
});
.search {
  display: block !important;
  position: relative;
  background-color: var(--bg-light);
}

.search input {
  text-indent: 25px;
}

.search input:focus {
  box-shadow: none;
  border: 2px solid var(grey);
}

.search input.form-control {
  display: block !important;
  width: 700px !important;
}

.search .fa-search {
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 2rem;
  z-index: 12;
}

/* 隐藏无结果的div */

h4 ~ div.noresults {
    margin-bottom: 2em;
    font-style: italic;
    display: none;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<section class="search">
  <div class="container">
    <div class="col-lg-9 mx-auto" id="research">
      <div class="search my-4">
        <input type="text" class="form-control mx-auto" id="searchInput" placeholder="Search resources">
      </div>
      <h4 class="sub-heading-alt-resources pb-3" id="#methodologies">Research</h4>
      <p>Ricardo R Bartelme, <a href="https://journals.sagepub.com/doi/10.1177/2164956120973634" target="_blank" rel="no-referrer">Anthroposophic Medicine: A Short Monograph and Narrative Review—Foundations, Essential Characteristics, Scientific Basis, Safety, Effectiveness and Misconceptions</a>, published 29 December 2020 in Pub Med, doi 10.1177/2164956120973634</p>
      <!-- 更多p标签 -->
      <div class='noresults'>no results</div>
      <!-- 更多noresults标签 -->
      <h4 class="sub-heading-alt-resources pt-3" id="pregnancy">Pregnancy, Birth and Early childhood</h4>
      <p>Gollmer B (15.01.2019) <a href="https://www.anthromedics.org/PRA-0779-EN" target="_blank">Painting Therapy in Pregnancy and Preparation for Childbirth</a> (professional information)</p>
      <!-- 更多p标签 -->
      <div class='noresults'>no results</div>
      <!-- 更多noresults标签 -->
      <h4 class="sub-heading-alt-resources" id="child-health">Child Health</h4>
      <p>Hamre HJ et al. (2009) <a href="https://www.researchgate.net/publication/26309949_Anthroposophic_therapy_for_children_with_chronic_disease_A_two-year_prospective_cohort_study_in_routine_outpatient_settings" target="_blank">Anthroposophic therapy for children with chronic disease: a two-year Prospective Cohort Study in Routine Outpatient Settings</a>. BMC Pediatr 2009; 9:39. DOI 10.1186/1471-2431-9-39</p>
      <!-- 更多p标签 -->
      <div class='noresults'>no results</div>
      <!-- 更多noresults标签 -->
      <h4 class="sub-heading-alt-resources" id="infectious">Infectious and chronic diseases</h4>
      <p>Hamre H J. Witt C M, Glockmann A, Ziegler R (July 2007) <a href="https://www.researchgate.com/publication/6158737_Anthroposophic_Art_Therapy_in_Chronic_Disease_A_Four-Year_Prospective_Cohort_Study" target="_blank">Anthroposophic Art Therapy in Chronic Disease: A Four-Year Prospective Cohort Study</a> The Journal of Science and Healing 3(4):365-71, Doi: 10.1016/j.explore.2007.04.008,</p>
      <!-- 更多p标签 -->
      <div class='noresults'>no results</div>
      <!-- 更多noresults标签 -->
      <h4 class="sub-heading-alt-resources" id="covid">COVID-19</h4>
      <p>Martin D, Soldner G (2020) <a href="https://www.anthromedics.org/PRA-0971-EN" target="_blank">A synthesis review of current status and proposal of a registry study to overcome social polarization tendencies and answer open research questions</a></p>
      <!-- 更多p标签 -->
      <div class='noresults'>no results</div>
    </div>
  </div>
</section>

希望这可以帮助您理解和使用提供的代码部分。

英文:

It looks hard to achieve this on this HTML structure .. But anyway you can try the next code

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

$(document).ready(function () {
$(&quot;#searchInput&quot;).on(&quot;keyup&quot;, function () {
const value = $(this).val().toLowerCase();
$(&#39;#research .noresults, #research h4 , #research p&#39;).css(&#39;display&#39; , &#39;none&#39;);
const filter_p = $(&quot;#research p&quot;).filter(function () {
return ($(this).text().toLowerCase()).indexOf(value) &gt; -1;
});
filter_p
.css(&#39;display&#39; , &#39;block&#39;)   //&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
.prevUntil(&#39;h4&#39;)
.prev(&#39;h4&#39;)
.css(&#39;display&#39; , &#39;block&#39;);
$(&#39;#research h4&#39;)
.not(filter_p.prevUntil(&#39;h4&#39;).prev(&#39;h4&#39;))
.nextUntil(&#39;.noresults&#39;)
.next(&#39;.noresults&#39;)
.css(&#39;display&#39; , &#39;block&#39;);
});
});

<!-- language: lang-css -->

.search {
  display: block !important;
  position: relative;
  background-color: var(--bg-light);
}

.search input {
  text-indent: 25px;
}

.search input:focus {
  box-shadow: none;
  border: 2px solid var(grey);
}

.search input.form-control {
  display: block !important;
  width: 700px !important;
}

.search .fa-search {
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 2rem;
  z-index: 12;
}

/* Hide nor results div */

h4 ~ div.noresults {
	margin-bottom: 2em;
	font-style: italic;
	display: none;
}

<!-- language: lang-html -->

&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;section class=&quot;search&quot;&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;col-lg-9 mx-auto&quot; id=&quot;research&quot;&gt;
&lt;div class=&quot;search my-4&quot;&gt;
&lt;input type=&quot;text&quot; class=&quot;form-control mx-auto&quot; id=&quot;searchInput&quot; placeholder=&quot;Search resources&quot;&gt;
&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources pb-3&quot; id=&quot;#methodologies&quot;&gt;Research&lt;/h4&gt;
&lt;p&gt;Ricardo R Bartelme, &lt;a href=&quot;https://journals.sagepub.com/doi/10.1177/2164956120973634&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;Anthroposophic Medicine: A Short Monograph and Narrative Review—Foundations, Essential Characteristics, Scientific Basis, Safety, Effectiveness and Misconceptions&lt;/a&gt;, published 29 December 2020 in Pub Med, doi 10.1177/2164956120973634&lt;/p&gt;
&lt;p&gt;Mehl A, Brauer D, Didwiszus A, Gelin-Kr&#246;z B, Pranga D, Zerm R, Gutenbrunner C (2020), &lt;a href=&quot;https://www.sciencedirect.com/science/article/abs/pii/S155083072030224X&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;The Anthroposophic Art Therapy Assessment Paint (AART-ASSESS-P): A peer-report instrument to assess patients’ pictorial expression during Anthroposophic Painting Therapy&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lees J (2001) &lt;a href=&quot;https://www.researchgate.net/publication/238318617_Reflexive_action_research_Developing_knowledge_through_practice&quot;&gt;Reflexive Action Research: Developing Knowledge Through Practice: Counselling and Psychotherapy Research&lt;/a&gt; (2001), August 2001, Counselling and Psychotherapy Research 1(2):132-138, &lt;a href=&quot;https://onlinelibrary.wiley.com/doi/abs/10.1080/14733140112331385178&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;DOI:10.1080/14733140112331385178&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Shlonsky A and Gobbs L, &lt;a href=&quot;https://www.researchgate.net/publication/247903648_Will_the_Real_Evidence-Based_Practice_Please_Stand_Up_Teaching_the_Process_of_Evidence-Based_Practice_to_the_Helping_Professions&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;Will the Real Evidence-Based Practice Please Stand Up? Teaching the Process of Evidence-based Practice to the Helping Professions. Brief Treatment and Criss Intervention.&lt;/a&gt; Vol 4. No. 2., January 2004, Brief Treatment and Crisis Intervention 4(2):137-153, &lt;a href=&quot;http://mr.crossref.org/iPage?doi=10.1093%2Fbrief-treatment%2Fmhh011&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;DOI:10.1093/brief-treatment/mhh011&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kienle G S, Albonico H U, Baars E, Hamre H J, Zimmermann P, Kiene H (2013). &lt;a href=&quot;https://www.hsleiden.nl/binaries/content/assets/hsl/lectoraten/antroposofische-gezondheidszorg/artikelgaiham.pdf&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;(pdf, 882 KB )Anthroposophic Medicine: An Integrative Medical System Originating in Europe. ( pdf, 882 KB )&lt;/a&gt; Global Advances In Health And Medicine November 2013, Volume 2, Number 6&lt;/p&gt;
&lt;p&gt;Abbing A, Ponstein A, Kienle G, Gruber H, Baars E (2016) The CARE-AAT Guideline: &lt;a href=&quot;https://www.tandfonline.com/doi/pdf/10.1080/17454832.2016.1170054?needAccess=true&quot;&gt;Development and testing of a consensus-based guideline for case reports in anthroposophic art therapy.&lt;/a&gt;&lt;a href=&quot;https://www.tandfonline.com/doi/pdf/10.1080/17454832.2016.1170054?needAccess=true&quot; target=&quot;_blank&quot; rel=&quot;no-referrer&quot;&gt;International Journal of Art Therapy, DOI: 10.1080/17454832.2016.1170054&lt;/a&gt;&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources pt-3&quot; id=&quot;pregnancy&quot;&gt;Pregnancy, Birth and Early childhood&lt;/h4&gt;
&lt;p&gt;Gollmer B (15.01.2019) &lt;a href=&quot;https://www.anthromedics.org/PRA-0779-EN&quot; target=&quot;_blank&quot;&gt;Painting Therapy in Pregnancy and Preparation for Childbirth&lt;/a&gt; (professional information)&lt;/p&gt;
&lt;p&gt;Gollmer B (19.07.2019) &lt;a href=&quot;https://www.anthromedics.org/PRA-0781-EN&quot; target=&quot;_blank&quot;&gt;Painting Therapy in Pregnancy and Birth Preparation&lt;/a&gt; (parent information)&lt;/p&gt;
&lt;p&gt;Bissegger M (07.06.2019) &lt;a href=&quot;https://www.anthromedics.org/PRA-0805-EN&quot; target=&quot;_blank&quot;&gt;Music Therapy for Premature Infants and their Mothers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bissegger M (02.01.2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0907-EN&quot; target=&quot;_blank&quot;&gt;Music Therapy for Babies and Toddlers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bissegger M (02.01.2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0905-EN&quot; target=&quot;_blank&quot;&gt;Singing and Music for Babies and Toddlers&lt;/a&gt; (parent information) ​&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources&quot; id=&quot;child-health&quot;&gt;Child Health&lt;/h4&gt;
&lt;p&gt;Hamre HJ et al. (2009) &lt;a href=&quot;https://www.researchgate.net/publication/26309949_Anthroposophic_therapy_for_children_with_chronic_disease_A_two-year_prospective_cohort_study_in_routine_outpatient_settings&quot; target=&quot;_blank&quot;&gt;Anthroposophic therapy for children with chronic disease: a two-year Prospective Cohort Study in Routine Outpatient Settings&lt;/a&gt;. BMC Pediatr 2009; 9:39. DOI 10.1186/1471-2431-9-39&lt;/p&gt;
&lt;p&gt;Abbing A, Krantz B, Simon E, Heynen E, De Witte M and Van Hooren S (2020). &lt;a href=&quot;https://www.crd.york.ac.uk/prospero/display_record.php?ID=CRD42020162709&quot; target=&quot;_blank&quot;&gt;Effectiveness of Music Therapy Interventions in Reducing Behavioural and Emotional Problems Among Children&lt;/a&gt;. PROSPERO 2020. CRD42020162709&lt;/p&gt;
&lt;p&gt;Baars E W, Koster E B, Schoorel E P (2012).&lt;a href=&quot;https://www.researchgate.net/publication/282149760_Client_experiences_with_an_integrated_conventional_and_anthroposophic_approach_at_the_Kindertherapeuticum_in_Zeist&quot; target=&quot;_blank&quot;&gt;Client experiences with an integrated conventional and anthroposophic approach at the Kindertherapeuticum in Zeist&lt;/a&gt;. Der Merkurstab, 4:335-338&lt;/p&gt;
&lt;p&gt;Niemeijer M H, Baars E W, Hoekman J, Ruijssenaars A J J M (2018) &lt;a href=&quot;https://www.researchgate.net/publication/330164731_An_Instrument_for_Dimensional_Diagnosis_of_a_Child_Constitution_ICC_Individualizing_the_Care_for_Children_with_Developmental_Disorders&quot; target=&quot;_blank&quot;&gt;An instrument for dimensional diagnosis of a child’s constitution (ICC)&lt;/a&gt;. International Journal of Complementary &amp; Alternative Medicine, Issue 2-2018.&lt;/p&gt;
&lt;p&gt;Niemeijer M H, Baars E W, Hoekman J, and Ruijssenaars A J J M (2018). &lt;a href=&quot;https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjournal.julypress.com%2Findex.php%2Fijsn%2Farticle%2Fdownload%2F531%2F401&amp;data=04%7C01%7Cbaars.e%40hsleiden.nl%7C806fd3cb33754902a30908d92b842ba7%7C850f9344e078467e9c5e84d82f208ac7%7C1%7C0%7C637588668989923315%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=RinbscVUm36ksES%2F4dpv3pCSyMP6bzjQFJ8WPTt0yBM%3D&amp;reserved=0&quot; target=&quot;_blank&quot;&gt;Validity and Reliability of the Instrument for Assessing the Child’s Constitution (ICC): Individualising Processes in Diagnosing Children With a Developmental Disorder&lt;/a&gt; . International Journal of Studies in Nursing, 3(3), 172.&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources&quot; id=&quot;infectious&quot;&gt;Infectious and chronic diseases&lt;/h4&gt;
&lt;p&gt;Hamre H J. Witt C M, Glockmann A, Ziegler R (July 2007) &lt;a href=&quot;https://www.researchgate.net/publication/6158737_Anthroposophic_Art_Therapy_in_Chronic_Disease_A_Four-Year_Prospective_Cohort_Study&quot; target=&quot;_blank&quot;&gt;Anthroposophic Art Therapy in Chronic Disease: A Four-Year Prospective Cohort Study&lt;/a&gt; The Journal of Science and Healing 3(4):365-71, Doi: 10.1016/j.explore.2007.04.008,&lt;/p&gt;
&lt;p&gt;Hamre H J et al. (2004). &lt;a href=&quot;https://www.researchgate.net/publication/8374153_Anthroposophic_therapies_in_chronic_disease_The_Anthroposophic_Medicine_Outcomes_Study_AMOS&quot; target=&quot;_blank&quot;&gt;Anthroposophic therapies in chronic disease: The Anthroposophic Medicine Outcomes Study (AMOS)&lt;/a&gt;. European Journal of Medical Research 2004; 9:351-360&lt;/p&gt;
&lt;p&gt;Hamre H J et al. (2007) &lt;a href=&quot;https://www.researchgate.net/publication/6158737_Anthroposophic_Art_Therapy_in_Chronic_Disease_A_Four-Year_Prospective_Cohort_Study&quot; target=&quot;_blank&quot;&gt;Anthroposophic Art Therapy in Chronic Disease: a four-year prospective cohort study&lt;/a&gt;. Explore (NY). 2007 Nov-Dec;3(6):553&lt;/p&gt;
&lt;p&gt;Hamre HJ et al. (2013). &lt;a href=&quot;https://www.researchgate.net/publication/249318203_Long-term_outcomes_of_anthroposophic_treatment_for_chronic_disease_A_four-year_follow-up_analysis_of_1510_patients_from_a_prospective_observational_study_in_routine_outpatient_settings&quot; target=&quot;_blank&quot;&gt;Long-term Outcomes of Anthroposophic Treatment for Chronic Disease: A four-year follow-up Analysis of 1510 Patients from a Prospective Observational Study in routine outpatient settings&lt;/a&gt; BMC Research Notes. 2013;6(1):269. DOI: &lt;a href=&quot;https://doi.org/10.1186/1756-0500-6-269&quot; target=&quot;_blank&quot;&gt;https://doi.org/10.1186/1756-0500-6-269&lt;/a&gt;&lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;h4 class=&quot;sub-heading-alt-resources&quot; id=&quot;covid&quot;&gt;COVID-19&lt;/h4&gt;
&lt;p&gt;Martin D, Soldner G (2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0971-EN&quot; target=&quot;_blank&quot;&gt;A synthesis review of current status and proposal of a registry study to overcome social polarization tendencies and answer open research questions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Soldner G, Breitkreuz T (2020) &lt;a href=&quot;https://www.anthromedics.org/PRA-0939-EN&quot; target=&quot;_blank&quot;&gt;COVID-19&lt;/a&gt; &lt;/p&gt;
&lt;div class=&#39;noresults&#39;&gt;no results&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;

<!-- end snippet -->

The tricks in this code

  • There're alot of &lt;p&gt; tags between &lt;h4&gt; and noresults .. So to select the matched h4 you'll need to use prevUntil With prev .. And the trick part is to select the next noresults so you'll need to start from the matched h4 not from the matched p.. this is why I'm using $(&#39;#research h4&#39;).not(filter_p.prevUntil(&#39;h4&#39;).prev(&#39;h4&#39;))

Additional:

  • If you want to hide the noresults when if any matched You can still use if(filter_p.length &gt; 0){ // code to show the matched }else{ // show no results }

huangapple
  • 本文由 发表于 2023年5月11日 05:12:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76222593.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定