source:
branches/testa/js/tab.js
| Last change on this file was 27, checked in by anonymous, 6 years ago | |
|---|---|
| File size: 560 bytes | |
| Rev | Line | |
|---|---|---|
| [25] | 1 | function tab_init(){ |
| [23] | 2 | $('.tab').click(function(){ |
| 3 | $('.is-active').removeClass('is-active'); | |
| 4 | $(this).addClass('is-active'); | |
| 5 | $('.is-show').removeClass('is-show'); | |
| 6 | // クリックしたタブからインデックス番号を取得 | |
| 7 | const index = $(this).index(); | |
| 8 | Globalx.index = index; | |
| 9 | Globalx.part = Globalx.parts[index]; | |
| 10 | // クリックしたタブと同じインデックス番号をもつコンテンツを表示 | |
| 11 | $('.panel').eq(index).addClass('is-show'); | |
| [27] | 12 | console.log("tab index="+index ) |
| [25] | 13 | }) |
| 14 | } |
Note: See TracBrowser
for help on using the repository browser.
![(trac.ini の [header_logo] セクションを設定してください)](/python/trac/Flist/chrome/common/trac_logo_mini.png)