Home  >  Article  >  Web Front-end  >  js original sound quickly implements tab

js original sound quickly implements tab

高洛峰
高洛峰Original
2016-10-12 16:39:411076browse

js original sound fast implementation tab

var Rea = document.getElementById("rep");
                    var ReaAll = Rea.querySelectorAll("li");
                    var Fall = document.getElementById("fall");
                    var FallAll = Fall.querySelectorAll("ul");
                    
                    for(var i=0;i<ReaAll.length;i++){ 
                       ReaAll[i].index=i;
                       ReaAll[i].onclick=function(){
                       for(var i=0;i<ReaAll.length;i++){
                           ReaAll[i].className=" ";
                           FallAll[i].style.display="none";
                       }
                       this.className="avtion";
                       FallAll[this.index].style.display="block";
                       }
                    }
<ul class="row rep_ad" id="rep">
                                        <li class="avtion">公告</li>
                                        <li>知识库</li>
                                    </ul>
                                    <div id="fall">
                                        <ul style="display:block;">
                                            <li>11111111111111111</li>
                                            <li>11111111111111111</li>
                                            <li>11111111111111111</li>
                                            <li>11111111111111111</li>
                                            <li>11111111111111111</li>
                                        </ul>
                                        <ul>
                                            <li>22222222222222222</li>
                                            <li>22222222222222222</li>
                                            <li>22222222222222222</li>
                                            <li>22222222222222222</li>
                                            <li>22222222222222222</li>
                                        </ul>
                                    </div>
                                </div>

js original sound quickly implements tab

js original sound quickly implements tab

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn