css3动画连续执行两个怎么做

html-css014

css3动画连续执行两个怎么做,第1张

animation定义和用法animation 属性是一个简写属性,用于设置六个动画属性:animation-nameanimation-durationanimation-timing-functionanimation-delayanimation-iteration-countanimation-direction默认值: none 0 ease 0 1 normal注释:请始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。语法 animation: name duration timing-function delay iteration-count directionanimation-name 规定需要绑定到选择器的 keyframe 名称。。animation-duration规定完成动画所花费的时间,以秒或毫秒计。animation-timing-function规定动画的速度曲线。animation-delay 规定在动画开始之前的延迟。animation-iteration-count 规定动画应该播放的次数。(值:n次,infinite无限循环)animation-direction 规定是否应该轮流反向播放动画。总结:根据上述属性,只需要根据具体情况设置animation-delay和animation-iteration-count即可。例如:div{animation:mymove 5s 5s infinite-webkit-animation:mymove 5s 5s infinite/* Safari 和 Chrome */}

使用setTimeout()和hide()。

setTimeout()方法用于在指定的毫秒数后调用函数或计算表达式。

hide(),实现隐藏这个已经显示的div。

以下为使用setTimeout()设定一个函数在2秒后执行

$(function () {setTimeout(function () {$("divid").hide()}, 2000)})

扩展资料

.show(),如果被选元素已被隐藏,则显示这些元素。

jQuery选择器

$("p") 选取 <p>元素。

$("p.intro") 选取所有 class="intro" 的 <p>元素。

$("p#demo") 选取所有 id="demo" 的 <p>元素。

$("[href]") 选取所有带有 href 属性的元素。

$("[href='#']") 选取所有带有 href 值等于 "#" 的元素。

$("[href!='#']") 选取所有带有 href 值不等于 "#" 的元素。

$("[href$='.jpg']") 选取所有 href 值以 ".jpg" 结尾的元素。

经查询以及和使用过的人交流可以知道,应该这样进行设置,animation-delay 属性定义动画什么时候开始。

animation-delay 值单位可以是秒(s)或毫秒(ms)。

提示: 允许负值,-2s 使动画马上开始,但跳过 2 秒进入动画。

语法

animation-delay: time

time可选。定义动画开始前等待的时间,以秒或毫秒计。默认值为0