Я пытаюсь создать эффект перехода (снизу вверх) в заголовке сразу после загрузки страницы, но не могу понять, почему он не работает.
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");
});
Демо: Fiddle
trigger()
запускает событие, вам нужно использовать < a href="http://api.jquery.com/animate/" rel="nofollow noreferrer">addClass()
напрямую. - person David says reinstate Monica   schedule 23.09.2012