【发布时间】:2013-11-07 23:58:56
【问题描述】:
使用 CSS3、HTML5、ASP.NET MVC4 C#。 MS Visual Studio。
我有以下 CSS...
.animated{-webkit-animation-fill-mode:both;
-moz-animation-fill-mode:both;
-ms-animation-fill-mode:both;
animation-fill-mode:both;
-webkit-animation-duration:1s;
-moz-animation-duration:1s;
-ms-animation-duration:1s;
-o-animation-duration:1s;
animation-duration:1s;}
@-webkit-keyframes bounceInRight {
0% {
opacity: 0;
-webkit-transform: translateX(2000px);
} 60% {
opacity: 1;
-webkit-transform: translateX(-30px);
}
80% {
-webkit-transform: translateX(10px);
}
100% {
-webkit-transform: translateX(0);
}
}
@-moz-keyframes bounceInRight {
0% {
opacity: 0;
-moz-transform: translateX(2000px);
}
60% {
opacity: 1;
-moz-transform: translateX(-30px);
}
80% {
-moz-transform: translateX(10px);
}
100% {
-moz-transform: translateX(0);
}
}
@keyframes bounceInRight {
0% {
opacity: 0;
transform: translateX(2000px);
}
60% {
opacity: 1;
transform: translateX(-30px);
}
80% {
transform: translateX(10px);
}
100% {
transform: translateX(0);
}
}
img.bounceInRight {
-webkit-animation-name: bounceInRight;
-moz-animation-name: bounceInRight;
animation-name: bounceInRight;
}
剃刀视图 sn-p 是...
<div class="row rowpadding">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
@Html.Action("BlogTags", "Blog")
@Html.Action("BlogMonths", "Blog")
</div>
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
<div class="row rowpadding">
@foreach (var item in Model.BlogPosts)
{
if(isFirst)
{
isFirst = false;
} else
{
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 news-cata-div-size">
<div><img class="bounceInRight" src="~/Themes/Renray/Content/images/small-1.png" /></div>
<div><span class="News-item-Date">@item.CreatedOn.ToString("D")</span></div>
<div><a class="News-item-title" href="@Url.RouteUrl("BlogPost", new { SeName = item.SeName })">@item.Title</a></div>
<div class="post-body">
@Html.Raw((item.Body.Length > 200 ? item.Body.Substring(0,200) : item.Body))
<a href="@Url.RouteUrl("BlogPost", new { SeName = item.SeName })">
...Read More?
</a>
</div>
</div>
}
}
</div>
</div>
</div>
我提供的视图 sn-p 很大的原因是因为我想让你们看到整个事情,因为您可能会注意到这是一个使用引导的响应式构建。
至于问题,动画应该从右侧反弹图像的每次迭代(动态图像的视图代码仍然不完整,但这不相关)。
加载时发生的一切都没有,没有动画效果。我想知道你们是否能指出我做错了什么。
非常感谢!
【问题讨论】:
-
您的
.animated课程未包含在您的 Razor sn-p 中。这个类真的有用吗? -
好点,忘记加了,这个还要加什么元素?
-
你的
img,大概。 -
是的,现在做得很好,真是个笨蛋
-
将其作为答案发布并确认,詹姆斯欢呼!
标签: c# html css asp.net-mvc-4 twitter-bootstrap