jquery实现菜单缩放
2021-03-09 06:28
标签:one round idt pre jquer 显示 display meta html jquery实现菜单缩放 标签:one round idt pre jquer 显示 display meta html 原文地址:https://www.cnblogs.com/TKOPython/p/12864881.htmlDOCTYPE html>
html lang="en">
head>
meta charset="UTF-8">
title>Titletitle>
script src="jquery-3.1.1.js">script>
style>
*{
margin: 0;
}
.menu1{
height: 100px;
width: 100%;
background-color: yellowgreen;
/*float: left;*/
line-height: 100px;
}
.con{
display: none;
}
style>
head>
body>
div class="navigationbar">
div class="menu1" onclick="onmenu(this)">菜单1div>
div class="con wo">
div>11111div>
div>11111div>
div>11111div>
div>
div>
div class="navigationbar">
div class="menu1" onclick="onmenu(this)">菜单2div>
div class="con wo">
div>22222div>
div>22222div>
div>22222div>
div>
div>
div class="navigationbar">
div class="menu1" onclick="onmenu(this)">菜单3div>
div class="con wo">
div>33333div>
div>33333div>
div>33333div>
div>
div>
body>
script>
function onmenu(self) {
$(self).next().removeClass("con"); //删除con后就显示con
//显示当前的con关闭其他的
$(self).parent().siblings().children(".wo").addClass("con");
}
script>
html>