English
To help a friend, I wrote a few simple tabs and dedicated them to friends in need. 1) Call multiple points
<html> <head> <style> body { text-align:center; } .tab { width:432px; height:208px; margin:0 auto; overflow:hidden; border:1px solid #cccccc; } .menu,.menu li { margin:0; padding:0; height:24px; list-style:none; overflow:hidden; text-align:center; } .menu { border-bottom:1px solid #cccccc; } .menu .default { width:84px; float:left; font-size:10pt; line-height:1.5; margin-left:1px; cursor:pointer; background:url('') no-repeat; } .menu . active { width:84px; float:left; font-size:10pt; line-height:1.5; margin-left:1px; cursor:pointer; font-weight:bold; color:#FFFFFF; background:url('') no-repeat; } #more { width:76px; float:left; font-size:10pt; line-height:1.5; margin-left:1px; cursor:pointer; color:#FF0000; font-weight:normal; text -align:right } .con { width:422px; height:184px; margin:0 auto; } </style> <head> <body> <script> function init(ids,cons,dis){ document.getElementById(ids ).getElementsByTagName('li')[0].className='active'; document.getElementById(cons).innerHTML=document.getElementById(dis+"l1").innerHTML; // document.getElementById(ids).onmouseover= function(){onmousOver(ids,cons,dis);}//The mouse pointer triggers the effect document.getElementById(ids).onclick=function(){onmousOver(ids,cons,dis);}//The click triggers the effect} function onmousOver(ids,cons,dis){ o = o || window.event; var obj=o.target || o.srcElement; if (obj.tagName=='LI'){ if (obj.className==' active'||obj.id=='more')return; var o=document.getElementById(ids).getElementsByTagName('li'); for (var i=0;i<=o.length-1;i++) {o[i].className='default'} obj.className='active'; if (obj.className=='active'){document.getElementById(cons).innerHTML=document.getElementById(dis+obj.id ).innerHTML;} } } </script> <!--#1--> <div class='tab'> <ul id='nav1' class='menu'> <li id="l1" class= 'default'>First News</li> <li id="l2" class='default'>Second News</li> <li id="l3" class='default'>Third News</li > <li id="l4" class='default'>The Fourth News</li> <li id="l5" class='default'>The Fifth News</li> </ul> <div class=' con' id='con1'> </div> </div> <div style="display:none"> <div id="div1_l1"> <span>I have been looking for a tab in the forum for a long time. There is no ideal effect</span> </div> <div id="div1_l2"> <span>So I am here to ask the experts, please help! </span> </div> <div id="div1_l3"> <span>I found a few to change, but the menu in the header is too difficult to locate. </span> </div> <div id=" div1_l4"> <span> It will change when the mouse is placed on it, no need to click! </span> </div> <div id="div1_l5"> <span>Added! </span> </div> </div> <script> init('nav1','con1',"div1_"); </script> <!--#2--> <div class='tab' > <ul id='nav2' class='menu'> <li id="l1" class='default'>First News</li> <li id="l2" class='default'>Second News </li> <li id="l3" class='default'>The Third News</li> <li id="l4" class='default'>The Fourth News</li> <li id="more "><a href="#" target=_blank>More>></a></li> </ul> <div class='con' id='con2'> </div> </div> <div style="display:none"> <div id="div2_l1"> <span>I want to make a tab, but I have been looking for it in the forum for a long time without the ideal effect</span> </div> <div id= "div2_l2"> <span>So I am here to ask the experts, please help me! </span> </div> <div id="div2_l3"> <span>I found a few to change, but the menu in the header is too difficult to locate. </span> </div> <div id=" div2_l4"> <span> It will change when the mouse is placed on it, without clicking! </span> </div> </div> <script> init('nav2','con2',"div2_"); </script> <!--#3--> <div class='tab' > <ul id='nav3' class='menu'> <li id="l1" class='default'>First News</li> <li id="l2" class='default'>Second News </li> <li id="l3" class='default'>Third News</li> <li id="more" style="width:160px"><a href="#" target=_blank> More>></a></li> </ul> <div class='con' id='con3'> </div> </div> <div style="display:none"> <div id ="div3_l1"> <span>I want to make a tab, but I have been looking for it in the forum for a long time without the ideal effect</span> </div> <div id="div3_l2"> <span>So I am here to ask the experts. Hey guys, please help! </span> </div> <div id="div3_l3"> <span>I found a few to change, but the menu in the header is too difficult to locate. </span> </div> </div> < script> init('nav3','con3',"div3_"); </script> </body> </html>