jquery_case2——下拉列表
作者:互联网
关联jquery_6
1. 第一版
利用slideUp、slideDown
button {
width: 200px;
height: 30px;
display: block;
}
p {
margin: 0;
padding: 0;
display: none;
height: 50px;
background-color: red;
width: 200px;
}
<button id="btn1">点击</button>
<p id="p1">p标签,点击button会滑动</p>
<button id="btn2">点击</button>
<p id="p2">p标签,点击button会滑动</p>
var slide = function (btn, p) {
var slide = true
$(btn).click(function () {
if (slide) {
slide = false
$(p).slideU
标签:jquery,btn,button,点击,列表,height,width,slide,case2 来源: https://blog.csdn.net/weixin_44292241/article/details/121288917