【发布时间】:2013-09-24 17:30:55
【问题描述】:
如下图所示,我必须创建此图像并为其设置动画。我原本打算不为此实际使用图像,而是使用 CSS3 border-radius 来执行此操作。所以,下面的 HTML 和 CSS 就是我所在的位置。
我想要的动画是箭头应该从底部开始出现并沿着流向上移动继续显示,向右移动直到箭头指针结束。但我真的不确定我该怎么做。我必须支持浏览器IE8+、chrome、FF。
HTML:
<div class="years">
<article>
<figure>
<div class="vrt-bar"></div>
<div class="hrzt-bar"></div>
<div class="arrow"></div>
</figure>
</article>
</div>
CSS:
.years article figure {
height:auto;
position:relative;
}
.years article figure .vrt-bar {
width:34px;
height:192px;
behavior: url(css/PIE.htc);
border-radius:25px 0 25px 25px;
-webkit-border-radius: 25px 0 25px 25px;
-moz-border-radius: 25px 0 25px 25px;
float:left;
background:#00b9d3;
position:relative;
}
.years article figure .hrzt-bar {
width:143px;
height:32px;
background:#00b9d3;
margin-left:34px;
}
.years article figure .arrow {
width: 0;
height: 0;
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #00b9d3;
position:absolute;
top:-10px;
left:177px;
}
jsfiddle:http://jsfiddle.net/KgAe4/
有人可以帮忙吗?
【问题讨论】:
-
那么根据 jsfiddle,您现在的基本需求是动画?
-
沃尔克,没错。我只是不知道该怎么做。
-
CSS3 过渡/动画在这里无法满足您的需求,因为您必须支持 IE8。在我的理解中最关键的一点是沿着左上角的箭头。我想您必须选择一个带有完整箭头的图层(已经存在),然后在顶部的另一个图层上使用背景隐藏尚未动画的部分和正在改变位置的箭头。带有边界半径的拐角动画似乎相当耗时。
-
好吧,我可以为最右上方的指针(即“箭头”类)保留流动画,但我仍然需要先为 vrt-bar 制作动画,然后再为顶部 hrzt-bar 制作动画。
-
或者即使它需要更改html/css,也可以。
标签: jquery html css jquery-animate