赞
踩
<!DOCTYPE html> <html lang="en"> <head> <meta name="renderer" content="webkit"> <meta name="force-rendering" content="webkit"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Page</title> <link rel="stylesheet" href="./assets/public/css/bootstrap.min.css"> </head> <body> <ul class="nav nav-tabs" role="tablist" id="myTab"> <li class="active"> <a href="#tab-maosms" role="tab" data-toggle="tab">maosms</a> </li> <li> <a href="#tab-frpc" role="tab" data-toggle="tab">frpc</a> </li> <li> <a href="#tab-system" role="tab" data-toggle="tab">system</a> </li> </ul> <div class="tab-content" id="myContent"> <div class="tab-pane active" id="tab-maosms"> <div id="terminal-maosms"></div> </div> <div class="tab-pane" id="tab-frpc"> <div id="terminal-frpc"></div> </div> <div class="tab-pane" id="tab-system"> <div id="terminal-system"></div> </div> </div> <script src="./assets/public/js/jquery.min.js"></script> <script src="./assets/public/js/popper.min.js"></script> <script src="./assets/public/js/bootstrap4.2.1.min.js"></script> <script src="./assets/public/js/axios.js"></script> <script src="./assets/public/js/qs.min.js"></script> <script src="./assets/js/tail.js"></script> </body> </html>
./assets/js/tail.js
的内容:$(function () {
var thisTab = 'a[data-toggle="tab"]';
$(thisTab).on('show.bs.tab', function (e) {
if (e.relatedTarget) {
var tabPaneNameOld = e.relatedTarget.getAttribute("href");
$(tabPaneNameOld).attr("class", "tab-pane");
}
$(e.target).parent().siblings().each(function (number, obj) {
$(obj).attr("class", "show");
});
$(e.target).parent().attr("class", "show active");
});
});
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。