Javascript 缓慢打开/关闭div?

Javascript 缓慢打开/关闭div?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我有下面的代码,在mouseover上打开/关闭图像上方的div。 有没有办法让它产生效果?如果有,有什么例子吗?我已经找过了,但我不是英雄 HTML: jsiddle:只需将其放在topcss中(3s是以秒为单位的时间,可以根据需要更改): 更新小提琴: 顺便说一句,all将使所有修改看起来很慢,如果您只想影响某些属性,则必须用属性名称替换all: 所有3s--->宽度1s,底部2s,高度0.2s 只需将其放入topcss(3s是以秒为单位的时间,可以根据需要更改): 更新小提琴: 顺便说一句

我有下面的代码,在mouseover上打开/关闭图像上方的div。 有没有办法让它产生效果?如果有,有什么例子吗?我已经找过了,但我不是英雄

HTML:


jsiddle:

只需将其放在
top
css中(3s是以秒为单位的时间,可以根据需要更改):

更新小提琴:

顺便说一句,
all
将使所有修改看起来很慢,如果您只想影响某些属性,则必须用属性名称替换all:

所有3s--->宽度1s,底部2s,高度0.2s


只需将其放入
top
css(3s是以秒为单位的时间,可以根据需要更改):

更新小提琴:

顺便说一句,
all
将使所有修改看起来很慢,如果您只想影响某些属性,则必须用属性名称替换all:

所有3s--->宽度1s,底部2s,高度0.2s

你可以使用

-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
 transition: all 0.5s ease;
css属性:

您可以使用

-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
 transition: all 0.5s ease;

css属性:

像这样更新.top的css

您已更新的

您可以阅读更多关于过渡的信息

如果您可以使用JavaScript来实现这一点,那就更好了,因为


像这样更新.top的css

您已更新的

您可以阅读更多关于过渡的信息

如果您可以使用JavaScript来实现这一点,那就更好了,因为


您可以使用css属性转换,下面是


您可以使用css属性转换,下面是


我不知道单凭CSS就可以做到这一点。谢谢你,学到了一些新东西!我不知道单凭CSS就可以做到这一点。谢谢你,学到了一些新东西!
-webkit-transition: all 3s;
-moz-transition: all 3s;
-ms-transition: all 3s;
-o-transition: all 3s;
transition: all 3s;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
 transition: all 0.5s ease;
.top {
        background: #008285;
        bottom: -50px;
        top: 330px;
            /* For Safari 3.1 to 6.0 */
        -webkit-transition-property: all;
        -webkit-transition-duration: 1s;
        /* Standard syntax */
        transition-property: all;
        transition-duration: 1s;
    }
.top {
    background: #008285;
    bottom: -50px;
    top: 330px;
    -webkit-transition: top .5s, bottom .5s, background, .5s; 
    transition: top .5s, bottom .5s, background, .5s;
}