how to disable tabs in Bootstrap. You can remove the attribute data-toggle=”tab” from the tab’s element to disable a Bootstrap tab. Further you can add the class .disabled to the parent
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Disable Clicks on Bootstrap Tabs</title> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> <script src="js/bootstrap.min.js"></script> </head> <body> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#home">Home</a></li> <li><a data-toggle="tab" href="#profile">Profile</a></li> <li class="disabled"><a href="#admin">Admin</a></li> </ul> <div class="tab-content"> <div id="home" class="tab-pane fade in active"> <p>Aliquip placeat salvia cillum iphone...</p> </div> <div id="profile" class="tab-pane fade"> <p>Vestibulum nec erat eu nulla rhoncu non neque...</p> </div> <div id="admin" class="tab-pane fade"> <p>Sed consequat ante in rutrum convallis...</p> </div> </div> </body> </html> |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.