123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- (function(){
- var menu = document.getElementById('tab_menu1');
- var content = document.getElementById('tab_content1');
- var menus = menu.getElementsByTagName('span');
- var current; // 現在の状態を保持する変数
- for (var i = 0, l = menus.length;i < l; i++){
- tab_init(menus[i], i);
- }
- function tab_init(link, index){
- var id = link.className;
- var page = document.getElementById(id);
- if (!current){ // 状態の初期化
- current = {page:page, menu:link};
- page.style.display = 'block';
- link.className = 'active';
- } else {
- page.style.display = 'none';
- }
- link.onclick = function(){
- current.page.style.display = 'none';
- current.menu.className = '';
- page.style.display = 'block';
- link.className = 'active';
- current.page = page;
- current.menu = link;
- return false;
- };
- }
- })();
-
- (function(){
- var menu = document.getElementById('tab_menu2');
- var content = document.getElementById('tab_content2');
- var menus = menu.getElementsByTagName('span');
- var current; // 現在の状態を保持する変数
- for (var i = 0, l = menus.length;i < l; i++){
- tab_init(menus[i], i);
- }
- function tab_init(link, index){
- var id = link.className;
- var page = document.getElementById(id);
- if (!current){ // 状態の初期化
- current = {page:page, menu:link};
- page.style.display = 'block';
- link.className = 'active';
- } else {
- page.style.display = 'none';
- }
- link.onclick = function(){
- current.page.style.display = 'none';
- current.menu.className = '';
- page.style.display = 'block';
- link.className = 'active';
- current.page = page;
- current.menu = link;
- return false;
- };
- }
- })();
-
- (function(){
- var menu = document.getElementById('tab_menu3');
- var content = document.getElementById('tab_content3');
- var menus = menu.getElementsByTagName('span');
- var current; // 現在の状態を保持する変数
- for (var i = 0, l = menus.length;i < l; i++){
- tab_init(menus[i], i);
- }
- function tab_init(link, index){
- var id = link.className;
- var page = document.getElementById(id);
- if (!current){ // 状態の初期化
- current = {page:page, menu:link};
- page.style.display = 'block';
- link.className = 'active';
- } else {
- page.style.display = 'none';
- }
- link.onclick = function(){
- current.page.style.display = 'none';
- current.menu.className = '';
- page.style.display = 'block';
- link.className = 'active';
- current.page = page;
- current.menu = link;
- return false;
- };
- }
- })();
|