[英]Javascript accordion acting weird
當我使用jsfiddle使用javascript創建簡單的手風琴時,效果很好,但是當我在.aspx中使用相同的代碼時,手風琴沒有打開。 我嘗試使用IE進行調試,但沒有用。 對此的任何指示將大有幫助。
我的jsfiddle鏈接-jsfiddle代碼
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].onclick = function () {
this.classList.toggle("active");
this.nextElementSibling.classList.toggle("show");
}
}
和我的HTML:
<div>
<button class="accordion">
Q1. Why does CMS collect patient-level
data?</button>
<div class="panel">
<p>
Patient-level data with patient-level identifiers for
the numerator and denominator of each measure allows CMS to match HEDIS data to
other patient-level data for special projects of national interest and research,
such as an assessment of whether certain groups (e.g., ethnic, racial, gender, geographic)
are receiving fewer or more services than others. These analyses will not be used
for public plan-to-plan comparisons.</p>
</div>
<button class="accordion">
Q2. What procedures must I follow to submit
patient-level data files?</button>
<div class="panel">
<p>
Plans need to create patient-level data file(s)
conforming to the 2010 Patient-Level Data File Specifications and upload files
to CMS via CMS’ Enterprise File Transfer (EFT) infrastructure using an existing
Gentran or Connect:Direct account. Alternatively, plans may use a third-party
vendor (e.g., Infocrossing) for data file submissions. In either case, the use
of Gentran or Connect:Direct is the approved method for patient-level data file
submissions.</p>
</div>
<button class="accordion">
Q3. Where do I find the data file submission
instructions?</button>
<div class="panel">
<p>
It is imperative that each organization confirm their ability to interface with
the CMS EFT infrastructure prior to attempting an upload. ior to attempting an upload.</p>
</div>
</div>
由於我導入了jQuery UI庫並解決了該問題,因此我將關閉它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.