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
I wrote a simple UDP server and client example be...
Preface Some people have asked me some MySQL note...
Preface When we were writing the horse, I guess e...
Introduction: MySQL database recovery by time poi...
Some properties in CSS are preceded by "*&qu...
Preface MySQL 8.0.13 began to support index skip ...
My page today also had garbled characters, so I s...
Table of contents 1. Cause 2. Equipment Informati...
This article uses a jQuery plug-in to create an a...
The default port number of the Windows server rem...
DOM Concepts DOM: document object model: The docu...
Start the mysql container in docekr Use command: ...
[LeetCode] 176. Second Highest Salary Write a SQL...
question By clicking a control, a floating layer ...
Mobile browsers place web pages in a virtual "...