source:
branches/testa-x/js/tab.js
| Last change on this file was 27, checked in by anonymous, 6 years ago | |
|---|---|
| File size: 560 bytes | |
| Line | |
|---|---|
| 1 | function tab_init(){ |
| 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'); |
| 12 | console.log("tab index="+index ) |
| 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)