Topic: Classic Tabs are not working in IE
kimfreesland pro asked 7 years ago
Mikołaj Smoleński staff answered 7 years ago
$(document).ready(function() { var navItems = document.querySelector('.nav.nav-tabs').children; var tabPanes = document.querySelectorAll('.tab-pane'); for(let i=0; i < navItems.length; i++) { navItems[i].addEventListener('click', navItemClick); } function navItemClick() { for(let i=0; i < navItems.length; i++) { navItems[i].children[0].classList.remove('active'); tabPanes[i].classList.remove('in'); tabPanes[i].classList.remove('show'); tabPanes[i].classList.remove('active'); console.log(tabPanes[i]); } this.children[0].classList.add('active'); let attr = this.children[0].getAttribute('href'); $(attr).addClass('in show active'); } });Regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No