The background is a date title. As the user slides, there is a ceiling effect when sliding to the current date list data, and this effect is different from the original style. 1. Implementation
scheduleInfo:[ { top: 8, currentDay: '2021-08-15' }, { top: 213, currentDay: '2021-08-14' }, { top: 555, currentDay: '2021-08-13' }, ... ]
This article will not show too much about CSS, the functional effect can be achieved as long as the logical thinking is correct 2. Problems
This figure shows the default UI display The UI display when the user slides to the list position under the date, or the situation where the first point of the problem exists Then it will affect the second point of the problem 3. Consider whether there is a better way to implement itThe first idea was to dynamically add a corresponding class to the date title of each element node to control the change of individual styles, but the class of each element is the same and this method cannot be used to solve it. Modification is done by controlling the style of each individual element node, but unlike the DOM in the browser, the mini program cannot change the style of each individual element through dom.style.xxx. IntersectionObserver, this method has also been tried, but it didn’t work. I’ll try it again when I have a chance. SummarizeThis is the end of this article about how to achieve ceiling effects with WeChat mini-programs. For more content related to ceiling effects with mini-programs, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL slow query operation example analysis [enable, test, confirm, etc.]
>>: How to change the system language of centos7 to simplified Chinese
The front-end and back-end projects are separated...
If the words in the sql statement conflict with t...
The nginx logs are collected by filebeat and pass...
In the previous chapters, we introduced how to ch...
1. Databases and database instances In the study ...
I have always wondered why the MySQL database tim...
Prepare: Define a teacher table and a student tab...
Today, when I was using Nginx, a 500 error occurr...
Use div to create a mask or simulate a pop-up wind...
Preface During the development process, we someti...
Table of contents LAMP architecture 1.Lamp Introd...
question Recently, when I was completing a practi...
sudo configuration file The default configuration...
What is a Viewport Mobile browsers place web pages...
This section provides an overview of some other i...