i have 3 tabs on end of page want link on top go way down , open tab best way? thanks
this links on top:
<div class="tab"> <a href="javascript:void(0)" class="tablinks" onclick="opencity(event, 'tokyo')"></a> </div> <div class="tab2"> <a href="javascript:void(0)" class="tablinks" onclick="opencity(event, 'paris')"></a> </div> <div class="tab3"> <a href="javascript:void(0)" class="tablinks" onclick="opencity(event, 'london')"></a> </div>
and tabs
<div id="close" class="tabcontent"> </div> <div id="london" class="tabcontent"> [insert page='246' display='content'] </div> <div id="paris" class="tabcontent"> [insert page='244' display='content'] </div> <div id="tokyo" class="tabcontent"> [insert page='193' display='content'] </div> <script> function opencity(evt, cityname) { var i, tabcontent, tablinks; tabcontent = document.getelementsbyclassname("tabcontent"); (i = 0; < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getelementsbyclassname("tablinks"); (i = 0; < tablinks.length; i++) { tablinks[i].classname = tablinks[i].classname.replace(" active", ""); } document.getelementbyid(cityname).style.display = "block"; evt.currenttarget.classname += " active"; } // element id="defaultopen" , click on document.getelementbyid("close").click(); </script>
thanks
you can try change href links:
<div class="tab"> <a href="#tokyo" class="tablinks" onclick="opencity(event, 'tokyo')"></a> </div> <div class="tab2"> <a href="#paris" class="tablinks" onclick="opencity(event, 'paris')"></a> </div> <div class="tab3"> <a href="#london" class="tablinks" onclick="opencity(event, 'london')"></a> </div>
clicking links scroll page automatically anchor
Comments
Post a Comment