我正在尝试在页面加载后立即在标题上创建过渡效果(从下到上),但我不知道为什么它不起作用。
HTML:
<div class="portfolio-title-wrap animate">
<div class="portfolio-title">Rooftop Garden </div>
<div class="location">San Francisco, CA</div>
</div>
CSS:
.animate {
background-color: #c00;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
position: absolute;
top: 100%;
right: 0;
}
.animate.move {
top: 0%;
margin-top: -700px;
}
.portfolio-title {
color: #F8941F;
font-weight:bold;
}
jQuery:
jQuery('.animate').trigger(
function() {
$(this).addClass("move");
});
演示: 小提琴