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
need: Use docker to start nginx + tomcat dual pro...
This article example shares the specific code for...
1. Change the Host field value of a record in the...
Background In Docker, four containers are created...
Table of contents Preface 1. Split a string 2. JS...
1. Overview In the daily operation and maintenanc...
Step 1. Enable MySQL slow query Method 1: Modify ...
Table of contents 1. Demand 2. Solution 3. The fi...
I logged into the backend to check the solution t...
introduction Looking back four years ago, when I ...
<br />How can I remove the scroll bar on the...
MySQL storage engine overview What is a storage e...
I have been in contact with PHP for so long, but ...
<br />Looking at this title, you may find it...
Add the jvm.options file to the elasticsearch con...