Home > Web Front-end > JS Tutorial > body text

js original sound quickly implements tab

高洛峰
Release: 2016-10-12 16:39:41
Original
1052 people have browsed it

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";
                       }
                    }
Copy after login
<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>
Copy after login

js original sound quickly implements tab

js original sound quickly implements tab

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!