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
This article shares the tutorial of MySql install...
It is common to view code effects in different br...
Table of contents 1 Create mount directories and ...
Arrange by functionNN : Indicates which earlier ve...
In order to avoid repeatedly entering the Docker ...
When writing a Dockerfile, include an entrypoint ...
This article shares simple HTML and music player ...
Angularjs loop object properties to achieve dynam...
Table of contents Preface Publish-Subscriber Patt...
I used to think that script could be placed anywh...
Let's look at the code first: ALTER TABLE rep...
Mind Map He probably looks like this: Most of the...
Table of contents history pushState() Method push...
max_allowed_packet is a parameter in MySQL that i...
Since we are going to upload pictures, the first ...