Html
    Css
    Js

    
                        
* {
	margin:0;
	padding:0;
}
#header {
	width:100%;
	height:50px;
	background-color:cadetblue;
	text-align:center;
	color:white;
	position:relative;
	overflow:hidden;
	transition:all 0.5s;
}
#header>p {
	line-height:50px;
}
.close {
	position:absolute;
	right:5%;
	top:0;
	padding:10px;
	line-height:30px;
	cursor:pointer;
}
.open {
	position:absolute;
	right:5%;
	padding:10px;
	line-height:30px;
	background-color:cadetblue;
	cursor:pointer;
	transition:all 0.5s;
	color:white;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

js 实现简易点击切换显示或隐藏(原创)

更新时间:2020-11-13 08:41:52

0