###試した事
cssアニメーションとjQueryを使って下記の動きを作成しました。
▶作成した動き
###教えていただきたい事
作成した動きを見て頂ければわかるかと思いますが、日付・タイトルの上を赤い.marqueeが通っています。
この赤く動く.marqueeのように日付・タイトルを、左→右へ表示させたいですが
どのように指定すればいいのかわからず途方に暮れております。
背景には画像が敷いてあるので色がついている赤いのは最終的に消したい(透明にしたい)のですが
色を指定しないと動かない(見えない)のでしかたなく色を付けております。
赤色のような動きで文字をなめらかに少しづつ表示できたらと思っています。
お分かりになられる方お見えになられましたらお助けください、宜しくお願い致します。
html
1<div id="top_news" class="top_fade mincho2"> 2 <ul> 3 <span class="top_postlist_date"><i class="fab fa-twitter"></i></span> 4 <li class="su-post"><span class="marquee su-post2"><a href="#"><span class="top_postlist_date">03/05</span>記事タイトル3</a></span></li> 5 <span class="top_postlist_date"><i class="fab fa-twitter"></i></span> 6 <li class="su-post"><span class="marquee su-post2"><a href="#"><span class="top_postlist_date">03/04</span>記事タイトル2</a></span></li> 7 <span class="top_postlist_date"><i class="fab fa-twitter"></i></span> 8 <li class="su-post"><span class="marquee su-post2"><a href="#"><span class="top_postlist_date">02/28</span>記事タイトル1</a></span></li> 9 </ul> 10</div>
css
1a{text-decoration: none;} 2li{list-style:none;} 3#top_news{ 4 margin-left:150px; 5 text-align: left; 6 position: absolute; 7 bottom: 150px; 8} 9#top_news a{ 10 color:#000; 11} 12#top_news ul li{ 13 font-size: 0.8em; 14 margin-bottom: 0.2em; 15} 16 17@keyframes marquee { 18 from { 19 transform: translateX(-100%); 20 } 21 to { 22 transform: translateX(100%); 23 } 24} 25.marquee { 26 display: inline-block; 27 position: relative; 28 overflow: hidden; 29 /* line-height: 0.8em; */ 30} 31 32.marquee::after { 33 content: ""; 34 display: block; 35 width: 100%; 36 height: 85%; 37 position: absolute; 38 top: 0; 39 left: 0; 40 z-index: 1; 41 background:rgba(255, 0, 0, 0.7); 42 animation-name: marquee; 43 animation-timing-function:ease; 44 animation-duration: 2s; 45 animation-fill-mode: forwards; 46}
回答1件
あなたの回答
tips
プレビュー