JS provides a simple multi-window display function for tab switching, and a jstab window display function.
This article describes the multi-window display function for JS to easily implement the tab switching effect. We will share this with you for your reference. The details are as follows:
<Div style = "text-align: center; margin-top: 40px; "> <div class =" menubox "> <span id =" newstab1 "class =" hover "onmouseover =" setTab ('newstab', 1, 3) "> <a href =" ### "target =" _ blank "> Department news </a> </span> <span id =" newstab2 "onmouseover =" setTab ('newstab ', 2, 3) "> <a href =" ### "target =" _ blank "> media reports </a> </span> <span id =" newstab3 "onmouseover =" setTab ('newstab ', 3, 3) "> <a href =" ### "target =" _ blank "> academic research </a> </span> </div> <Div class = "contentbox"> <div id = "con_newstab_1"> <ul> <li> <span> 2015-09-09 </span> <a href = "###" target = "_ blank"> who will read this article and ask 1 </a> </li> <span> </span> <a href =" ### "target =" _ blank "> who asked Junyi about yunqi Yunxiang? 1 </a> </li> <span> </span> <a href = "###" target = "_ blank"> who can read this article and ask 1 </a> </li> </ul> </div> <div id = "con_newstab_2" style = "display: none; "> <ul> <li> <span> 2015-09-09 </span> <a href =" ### "tar Get = "_ blank"> who will read this article and ask 2 </a> </li> <span> </span> <a href =" ### "target =" _ blank "> who asked 2 </a> </li> <span> </span> <a href = "###" target = "_ blank"> who can read this article and ask 2 </a> </li> </ul> </div> <div id = "con_newstab_3" style = "display: none; "> <ul> <li> <span> 2015-09-09 </span> <a href =" ### "target =" _ blank "> who can read this question? 3 </a> </li> <span> 2015-08-17 </span> <a href = "###" target = "_ blank"> who can read yunshui falls in the fragrance 3 </a> </li> <span> </span> <a href = "###" target = "_ blank"> yunshui falls in the fragrance of 3 </a> </li> </ul> </div> <script type = "text/javascript"> function setTab (name, cursel, n) {for (I = 1; I <= n; I ++) {var menu = document. getElementById (name + I); var con = document. getElementById ("con _" + name + "_" + I); menu. className = I = cursel? "Hover": ""; con. style. display = I = cursel? "Block": "none" ;}}</script>
: