2013-11-15 53 views
1

在visual studio中使用jquery製作手風琴選項卡並且此時窗格不會展開或摺疊。我得到這個錯誤 遺漏的類型錯誤:對象的翻譯:有沒有方法 '標籤' 這裏是我的html在jQuery中使用asp.net中的選項卡製作手風琴

<section id="Popularquestions"> 
      <h4>Popular Questions</h4> 
     <h5 class="current">1.What are the most common camera ports?</h5> 
     <div class="pane"><p><a href="Knowledgebase/commonports.aspx">Here</a> is a table of the most common camera ports available</p></div> 
     <h5>2.Where can I see a list of vendors and their MAC addresses?</h5> 
     <div class="pane"><p></p></div> 
     <h5>3.Where can I see a list of makes and models?</h5> 
     <div class="pane"><p></p></div> 
     <h5>4.Where can I see a list of usernames and passwords?</h5> 
     <div class="pane"><p></p></div> 
     <h5>5.Where can I see a list of available apps?</h5> 
     <div class="pane"><p></p></div> 

jQuery的

<script src="assets/jquery.js"></script> 
    <script> 
     $("#accordion").tabs(
    "#accordion div.pane", 
    { tabs: 'h2', effect: 'slide', initialIndex: null } 
); 
    </script> 

和CSS

#accordion { 
    background:#333 url(/media/img/gradient/h300.png) 0 0; 
    width: 300px; 
    border:1px solid #333; 
    -background:#666; 
    margin: 0 auto; 
} 

/* accordion header */ 
#accordion h2 { 
    background:#ccc url(/media/img/gradient/h30.png); 
    line-height: 14px; 
    margin:0; 
    padding:5px 15px; 
    font-size:14px; 
    font-weight:normal; 
    border:1px solid #fff; 
    border-bottom:1px solid #ddd; 
    cursor:pointer; 
} 

/* currently active header */ 
#accordion h2.current { 
    cursor:default; 
    background-color:#fff; 
} 

/* accordion pane */ 
#accordion .pane { 
    border:1px solid #fff; 
    border-width:0 2px; 
    display:none; 
    height:180px; 
    padding:15px; 
    color:#fff; 
    font-size:12px; 
} 

/* a title inside pane */ 
#accordion .pane h3 { 
    font-weight:normal; 
    margin:0; 
    font-size:16px; 
    color:#999; 
} 
+0

id ='accordion'的div在哪裏? – jeff

+0

intellisense不識別方法的.tabs部分,所以我在那裏丟失了什麼? – Ronan

+0

我剛剛補充說,除了CSS以外沒有任何區別,同樣的錯誤是 – Ronan

回答

1

像這樣嘗試:

<script> 
$(function() { 

$("#accordion").tabs(
    "#accordion div.pane", 
    { tabs: 'h2', effect: 'slide', initialIndex: null } 

}); 
</script>