gpt4 book ai didi

javascript - 转换计时功能不起作用

转载 作者:行者123 更新时间:2023-11-28 16:25:54 26 4
gpt4 key购买 nike

第一个问题是 transition timing function 不起作用(总是作为 transition timing function: linear,第二个问题我想为transition timing function

设置两个设置
  1. 设置以防减小窗口大小easy out
  2. 设置以防增加窗口大小“线性”

有什么办法解决吗?

/*====== Ignore section __start ======*/

* {
margin:0;
padding:0;
}

html, body {
height: 100%;
}

body {
background-color: #eee;
}

.wrapper {
height: 100%;
display: table;
width: 100%;
text-align: center;
border-collapse: collapse;
}

header {
box-sizing: border-box;
display: table-row;
height: 50px;
background-color: #eee;
border-bottom: 1px solid #999;
}

main {
height: 100%;
display: table;
width: 800px;
margin: 0 auto;
background-color: #fff;
padding-bottom: 50px;
}

section {
display: table-cell;
}
/*====== Ignore section __end ======*/


aside {
display: table-cell;
box-sizing: border-box;
border-left: 1px solid #ccc;
width: 300px;
box-shadow: -15px 0 0 rgba(51, 51, 51, .5);

/*__transition*/
transition-timing-function: ease-out;
opacity: 1;
transition: all 2s;
}

/*====== Ignore section __start ======*/
footer {
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
border-top: 1px solid #999;
display: table-row;
height: 50px;
background-color: #eee;
}

@media screen and (max-width: 800px) {

main {
width: 100%;
}
}
/*====== Ignore section __end ======*/

@media screen and (max-width: 700px) {

aside {
box-shadow: -15px 0 0 rgba(51, 51, 51, 0);
opacity: 0;
width: 0;
border: 0px solid transparent;
font-size: 0;
}
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div class="wrapper">
<header>HEADER</header>
<main>
<section>SECTION</section>
<aside>ASIDE</aside>
</main>
<footer>FOOTER</footer>
</div>
</body>
</html>

最佳答案

您正在使用 transition 速记覆盖 transition-timing-function 值。

将两者合并:

aside {
...
transition: all 2s ease-out;
}

或者改变声明的顺序:

aside {
...
transition: all 2s;
transition-timing-function: ease-out;
}

关于javascript - 转换计时功能不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44954333/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com