由于包含import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class LoadTest extends Simulation {
private val csvFeeder = csv("data.csv").random
val httpConf = http
.baseURL("http://localhost:5000/sample")
.acceptHeader("text/html,application/xhtml+xml,application/json,application/xml;q=0.9,*/*;q=0.8")
val scn = scenario("load test")
.feed(csvFeeder)
.exec(http("request")
.post("http://localhost:5000/sample")
.body(StringBody(s"""{"inputData": ${csvFeeder} }""")).asJSON
setUp(
scn.inject(
constantUsersPerSec(50)
during (10 seconds) randomized).protocols(httpConf))
}
的类本身的性质,我正在使用toggleClass
功能来应用和删除CSS类,但是此处的代码将更加通用,以帮助其他人理解坚果和螺栓。
当将类添加到元素中时,我可以进行转换,但是在删除它时我似乎无法获得一个转换。有人可以帮忙吗?
HTML
:before
CSS
<div class="container" id="container" on-scroll="toggleShadow">
<div class="content">
</div>
</div>
JS(聚合物)
.blue {
transition: all 1s;
background: blue;
}
.container {
height: 300px;
border: 1px solid grey;
overflow: auto;
}
.content {
margin: auto;
width: 50px;
height: 800px;
background: linear-gradient(lightblue, limegreen);
}
答案 0 :(得分:0)
当应用.blue时,您只有转换效果,而是将转换放在.container
上.blue {
background: blue;
}
.container {
transition: all 1s;
height: 300px;
border: 1px solid grey;
overflow: auto;
}