Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (document.getElementById("tab1")) {
- document.getElementById("tab1").style.display = "flex";
- document.getElementsByClassName("tablinks")[0].className += " active";
- }
- var durl = String(document.URL);
- if (durl.indexOf("#") != -1) {
- durl = durl.substring(durl.indexOf("#") + 1,durl.length);
- openTab(event, durl);
- }
- function openTab(evt, name) {
- var i, tabcontent, tablinks;
- tabcontent = document.getElementsByClassName("tabcontent");
- for (i = 0; i < tabcontent.length; i++) {
- tabcontent[i].style.display = "none";
- }
- tablinks = document.getElementsByClassName("tablinks");
- for (i = 0; i < tablinks.length; i++) {
- tablinks[i].className = tablinks[i].className.replace(" active", "");
- }
- document.getElementById(name).style.display = "flex";
- if (evt == undefined) {
- document.getElementsByClassName(durl)[0].className += " active";
- setTimeout(function() {
- window.scroll(0, document.getElementsByClassName("tab")[0].offsetTop)
- }, 1000);
- } else {
- evt.currentTarget.className += " active";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement