이 기사의 예는 참조에 대한 JS 탭 효과의 특정 구현 코드를 공유합니다. 특정 내용은 다음과 같습니다
생식 이미지 :
구현 코드 :
<html> <head> <meta http-equiv = "content-type"content = "text/html; charset = gb2312"/> <title> 제목이없는 문서 </title> <style type = "text/css"> body {font-size : 12px;} .sec1 {cursor :}. 글꼴 중량 : 대담한; 텍스트 정렬 : 센터; 배경색 :#990000;} .sec1 {색상 :#990000; 텍스트 정렬 : 센터; 배경색 : #fffff;} div {line-height : 22px;} </style> <script language = "javaScript"> function $ (id) {return document.getElementById (id); } 함수 xxk (num, id, ii, iii) {// alert (ii); var dq; for (var i = 1; i <= num; i ++) {if (i == id) {dq = $ (ii+i) .className = 'sec'; // 현재 옵션 $ (iii+i) .style.display = "block"; } else {dq = $ (ii+i) .className = 'sec1'; $ (iii+i) .style.display = "none"; }}}}} </script> </head> <body> <Table CellPadding = "4"CellPacing = "1"BorderColor = "#ffffff"bgcolor = "#990000"> <td id = "t1"onMouseOver = "xxk (5,1, 't', 'tt')"> td> <td> <td> bgcolor = "#ffffff"id = "t2"onmouseover = "xxk (5,2, 't', 'tt')"> tab2 </td> <td bgcolor = "#fffff"id = "t3"onMouseOver = "xxk (5,3, 't', 'tt')"> tab 3 </td> <td bgcolor = "#ffffff"id = "t4"onmouseover = "xxk (5,4, 't', 'tt')"> 탭 4 </td> <td bgcolor = "#ffffff"id = "t5"onMouseOver = "xxk (5,5, 't', 'tt')"> td> <tt> <tt> colspan = "5"bgcolor = "#ffffff"> <div id = "tt1"> 1 월에 서빙 </div> <div id = "tt2"style = "display : none;"> 탭은 2 월에 작업 중입니다. Style = "display :"> 탭은 4 월에 작동 중입니다 </div> <div id = "tt5"style = "display : none;"> 탭은 5 월에 작동합니다 </div> </td> </tr> </table> <br/> <table cellpadding = "4"셀 패팅 = "1"BorderColor = "#ffffff"#9900000 "> id = "ts1"onclick = "xxk (4,1, 'ts', 'tts')"> tab 1 </td> <td bgcolor = "#ffffff"id = "ts2"onclick = "xxk (4,2, 'ts', 'ts')"> 탭 2 </td> <td> <ts 3 " onclick = "xxk (4,3, 'ts', 'ts')"> tab 3 </td> <td bgcolor = "#ffffff"id = "ts4"onclick = "xxk (4,4, 'ts', 'ts')" "> 탭 4 </td> <tr colspan = 4"bgcolop = "#"#"#"#"#"#" <div id = "tts1"> 탭은 1 월에 일하고 있습니다 </div> <div id = "tts2"style = "display : none;"> 탭은 2 월에 작업 중입니다. </body> </html>위의 내용은이 기사에 관한 모든 것입니다. 모든 사람의 학습에 도움이되기를 바랍니다.