페이지가로드 된 직후 제목에 전환 효과 (아래에서 위로)를 만들려고하는데 왜 작동하지 않는지 알 수 없습니다.jQuery 트리거가 작동하지 않습니다.
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
피들의 왼쪽 드롭 다운에서 jQuery를 선택하십시오. 그리고 다른 점을 제외하면이 코드가 무엇을 기대하며, 그렇게하지 않았는지? 덧붙여 말하자면 [trigger()'] (http://api.jquery.com/trigger/)가 * event *를 트리거하기 때문에 필요한 것은 ['addClass()'] (http : //api.jquery .com/animate /). –