한 줄에 두 줄의 텍스트가있는 경우 각 라인의 내용은 동적입니다.애니메이션, AngularJS : 초당 픽셀 단위의 애니메이션 속도?
애니메이션 속도를 초당 픽셀로 설정하는 방법이 있습니까? 그래서 그 선은 길이에 관계없이 같은 속도로 스크롤 할 것입니까? 상황의
예 : AngularJS directive
및 CSS
의
div {
width: 50%;
padding-left: 10%;
float: left;
height: 50px;
overflow: hidden;
position: relative;
}
#line1 {
background-color: green;
}
#line2 {
background-color: yellow;
}
h4 {
position: absolute;
height: 100%;
margin: 0;
line-height: 50px;
text-align: left;
/* Apply animation to this element */
/* Animation delay 0.5s */
-moz-animation: line-scroll 15s linear 0.5s infinite;
-webkit-animation: line-scroll 15s linear 0.5s infinite;
animation: line-scroll 15s linear 0.5s infinite;
}
#line1 h4 {
/* width must be big enought to fit in whole text othrwise
whole text will not scroll into view */
width: 200%;
}
#line2 h4 {
/* width must be big enought to fit in whole text othrwise
whole text will not scroll into view */
width: 600%;
}
@keyframes line-scroll {
0% {
-moz-transform: translateX(0%);
/* Firefox bug fix */
-webkit-transform: translateX(0%);
/* Firefox bug fix */
transform: translateX(0%);
}
100% {
-moz-transform: translateX(-100%);
/* Firefox bug fix */
-webkit-transform: translateX(-100%);
/* Firefox bug fix */
transform: translateX(-100%);
}
}
<div id="line1">
<h4>I don't want to come off as arrogant here, but I'm the greatest botanist on this planet.</h4>
</div>
<div id="line2">
<h4>Every human being has a basic instinct: to help each other out. If a hiker gets lost in the mountains, people will coordinate a search. If a train crashes, people will line up to give blood. If an earthquake levels a city, people all over the world will send emergency supplies. This is so fundamentally human that it's found in every culture without exception. Yes, there are assholes who just don't care, but they're massively outnumbered by the people who do. ~ Mark Watney, The Martian</h4>
</div>
수단을 환영합니다.
내가 jQuery를 사용하여 솔루션을 찾았을 것입니다. 같은 것을 확인할 수 있습니다. 나는 그것이 당신의 문제를 해결한다고 생각합니다. – geeksal
@geeksal : 좋아 보인다. –
고마워요! 귀하의 문제가 해결되었다고 생각하는 경우 허용되는 것으로 표기하십시오. – geeksal