This article example shares the specific code of vue3 to achieve CSS infinite seamless scrolling effect for your reference. The specific content is as follows template Double-layer div nesting for hidden scrolling display <div class="list-container"> <div class="marquee" id="carList"> <template v-for="(item, index) in dataMap.list" :key="index"> <div class="list-item"> <div class="item-name text-overflow">{{ item.name }}</div> <div class="item-road text-overflow">{{ item.road }}</div> </div> </template> </div> </div> script Copy the content in the DOM element and connect to the last scrolling effect export default defineComponent({ setup() { const dataMap = reactive({ list: [ { name: '浙A89268', road: '游8路', status: 0 }, { name: '浙A89268', road: '游8路', status: 0 }, { name: '浙A89268', road: '游8路', status: 1 }, { name: '浙A89268', road: '游8路', status: 0 }, { name: '浙A89268', road: '游8路', status: 1 }, { name: '浙A89268', road: '游1路', status: 0 }, ], }); onMounted(() => { const marquee = document.getElementById('carList'); marquee.innerHTML = marquee.innerHTML + marquee.innerHTML; }); } }) style CSS handwriting animation effect .list-container { width: 720px; height: 170px; margin-left: 13px; overflow: hidden; position: relative; } //Infinite scroll.marquee { //animation-delay: -5s; animation: marquee 15s linear infinite; } .marquee:hover { animation-play-state: paused; } @keyframes marquee { 0% { transform: translateY(0%); } 100% { transform: translateY(-51%); //This is not -100%! } } The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: What should I do if I want to cancel an incorrect MySQL command?
>>: How to hide the version number in Nginx
Table of contents Table definition auto-increment...
Take zabbix's own WEB interface as an example...
1. Download: http://www.oracle.com/technetwork/ja...
1. Install the dependency packages first to avoid...
When we check the source code of many websites, w...
Heart Attributes opacity: .999 creates a stacking...
MySQL temporary tables are very useful when we ne...
Preface : Today I was asked, "Have you carefu...
The Spring Boot project uses docker containers, j...
Preface There is a scenario where, for the sake o...
Table of contents Error message Cause Error demon...
<br />Previous article: Web Design Tutorial ...
Here is a brief introduction to indexes: The purp...
aforementioned This article is very short~ The ma...
The same server simulates the master-slave synchr...