2014-02-19 84 views
0

我更新了jQuery JS,將最新的1.10.2替換爲1.8.2,這裏是 - 我的選項卡和手風琴不再工作。我之前在手寫板中使用過Accordion,但肯定有些東西必須修改才能恢復,但是由於我對JS的知識有限,我認爲除了回滾到1.8.2之外沒有一種簡單的方法,坦率地說,我不想做。 所以我的問題是 - 如何正確更新現有的HTML結構中的JS來保留功能。任何建議,至少在哪裏看?謝謝。jQuery更新後激活選項卡和手風琴

下面是手風琴的選項卡中的結構,我有:

<div id="Chapters">        <!--Begin Tabs--> 
    <ol type="1"> 
    <li><a href="#Ch1">Chapter 1</a></li> 
    <li><a href="#Ch2">Chapter 2</a></li> 
    <li><a href="#Ch3">Chapter 3</a></li> 
    </ol> 


    <div id="Ch4" title="Chapter 4"> 
<h2 class="Chapter">Chapter 4</h2> 
<div class="SubChapter" id="SubCh1" title="Title chapter 4"> 
    <h3>Title chapter 4</h3> 
    <div><p>content</p></div> 

<div class="questions">       <!--Begin Accordion --> 
<div id="QBlock">       
<table id="QTable"> 
<tr><td><div id="QNumber">4.1</div></td> 
    <td><div id="QText">text of question</div></td> <!-- Accordion panel header --> 
     </tr></table></div> 
<div> 
    <table id="RTable">         <!--Accordion panel content --> 
<tr><td><div id="Guidance"><p>Content</p></div></td> 
    <td><div id="Response" class="Response"> 
    <label><input type="radio" name="Radio401" value="Y" id="Radio_401Y" onchange='radioChange(this, "401")'>Yes</label> 
    <label><input type="radio" name="Radio401" value="N" id="Radio_401N" onChange='radioChange(this, "401")'>No</label> 
    <label><input type="radio" name="Radio401" value="NS" id="Radio_401NS" onChange='radioChange(this, "401")'>Not Seen</label> 
    <label><input type="radio" name="Radio401" value="NA" id="Radio_401NA" onChange='radioChange(this, "401")'>Not Applicable</label> 
</div> 
<span id="responseDetails"> 
    <div id="Observation"> 
    <label for="observation">Observation:</label> 
    <textarea name="observation" id="Obs401"></textarea></div> 
    <div id="DueDate"> 
    <label for="DueDate">Due date:<br></label> 
    <input name="DueDate" type="date" id="DueDate401"/> 
    </div> 

    <div id="actions"> 
    <label for="actions">Actions required to correct and/or prevent this observation:</label> 
    <textarea name="actions" id="pa401"></textarea> 
    </div> 
</span> 
</td> 
</tr> 
</table> 
</div> 
+0

用出其代碼很難猜到 – Prashobh

+0

也升級了jquery ui庫。 – Jai

+0

通過包含代碼 – Alexander

回答

0

當粘貼新的jQuery JS代碼到現有的文件(不是外部JS),一定要避免覆蓋這段代碼:

<script> 
$(function() { 

     $(".questions").accordion(); 
     $("#Chapters").tabs(); 

     // Hover states on the static widgets 
     $("#dialog-link, #icons li").hover(
      function() { 
       $(this).addClass("ui-state-hover"); 
      }, 
      function() { 
       $(this).removeClass("ui-state-hover"); 
      } 
     ); 
    }); 
</script> 
相關問題