有没办法让点击一个 div,来执行另一个 div 的动画? 比如我建立两个 box,一个 box1,一个 box2,box1 比如是按钮。box2 比如是一个菜单。默认 box2 菜单是 height: 0px,看不见,点击 box1 后,box2 的 height: 0px 变成 400px,就能看到点击 box1,box2 打开的效果。但是不是很理解这个是怎么用。
有没办法让点击一个 div,来执行另一个 div 的动画? 比如我建立两个 box,一个 box1,一个 box2,box1 比如是按钮。box2 比如是一个菜单。默认 box2 菜单是 height: 0px,看不见,点击 box1 后,box2 的 height: 0px 变成 400px,就能看到点击 box1,box2 打开的效果。但是不是很理解这个是怎么用。
1
CSGO OP |
2
azh7138m Oct 22, 2018
|
3
Pudge1337 Oct 22, 2018 via Android
为何不用 js
|
5
rabbbit Oct 22, 2018
|
6
sxy62016 Oct 22, 2018 via Android
点击可以用 checkbox 的 checked 属性实现
|
7
wly19960911 Oct 22, 2018
@Pudge1337 js 写好动画比 css 要难一点。
|
8
rabbbit Oct 22, 2018
|
10
Sparetire Oct 23, 2018 via Android
label+checkbox+兄弟元素选择器,隐藏掉 checkbox
|
12
lraining Oct 23, 2018 via Android
$(#box1).click(function(){
$(#box2).animate({height:400},'slow','easeOutSine',null); }); |