Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem if the hidden in WeChat Mini Programs is not effective?

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "how to solve if the hidden does not take effect in WeChat Mini Programs". The editor shows you the operation process through an actual case. The operation method is simple and fast, and it is practical. I hope this article "how to solve the problem if the hidden does not take effect in WeChat Mini Programs" can help you solve the problem.

The solution to the reason why hidden is not effective in WeChat Mini Programs

For example, the following layout:

Text1 text2

You'll find that hidden doesn't work. Through my experiments, I found that the hidden element only works on the block layout, so the culprit in this code that hidden doesn't work is display:flex. Just get rid of this.

What if I have to use a flex layout?

In fact, the only way to use hidden here is to hide this layout, and display:none can also hide it. Here, you can use a trick method to set the display property dynamically. The example is as follows:

Text1 text2

The hideview here is a variable in the corresponding js, which is dynamically controlled by js.

Hidden hides the layout, although it is hidden, it still takes up space.

Display:none hiding does not take up space.

This is the end of the content about "how to solve the problem if the hidden does not take effect in WeChat Mini Programs". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report