본문 바로가기

[IT/Programming]/HTML related

Parent DOM (Document Object Model) 이 hidden 일 때, child element 가 update 되면 hidden 이 풀릴 때 해결법

반응형
# Parent DOM (Document Object Model) 이 hidden 일 때, child element 가 update 되면 hidden 이 풀릴 때 해결법
Recoeve.net 개발하면서 목록 (ToR) 이 다른 카테고리로 옮겨갈때 갑자기 pop-up 되는 현상이 발생했는데, 이게 카테고리가 바뀌면서 목록이 update 되고 목록 (ToR) 의 child elements 가 update 되면서 발생하는 문제 같았다.
역시나 만능 ChatGPT 에 문의 결과 대충의 답의 힌트를 얻을 수 있었는데... children DOM 의 displayinherit 으로 하면 해결되는 문제였다. ## PH
  • 2023-12-03 : First posting.
## TOC ## To ChatGPT in Windows 11 :: Why is a hidden DOM shown after child elements are updated? There are several possible reasons why a hidden DOM element is shown after child elements are updated. Some of the common ones are: - The child elements have a CSS property that overrides the visibility of the parent element, such as visibility: visible or display: block. This can happen if the child elements are added dynamically and have a different style than the parent element. To fix this, you can use visibility: inherit or display: inherit on the child elements, which will make them follow the visibility of the parent element . - The parent element is hidden using the hidden attribute, which is a boolean attribute that indicates whether the element is relevant or not. However, some browsers may not support this attribute, or some scripts may change its value. To fix this, you can use a CSS rule that sets display: none on the elements that have the hidden attribute, which will make them hidden regardless of the browser or script. For example: ```[.lang-css] // CSS // AI가 생성한 코드입니다. 신중하게 검토하고 사용하세요. FAQ의 자세한 정보. [hidden] { display: none !important; } ```/ - The parent element is hidden using the opacity property, which sets the transparency of the element. However, this property does not affect the visibility of the element, only its appearance. The element still occupies space and can receive events. To fix this, you can use the visibility property or the display property instead of the opacity property, which will make the element truly hidden. For example: ```[.lang-css] // CSS // AI가 생성한 코드입니다. 신중하게 검토하고 사용하세요. FAQ의 자세한 정보. .hidden { /* opacity: 0; */ /* this will not hide the element */ visibility: hidden; /* this will hide the element */ /* or */ display: none; /* this will also hide the element */ } ```/ I hope this answer helps you understand why a hidden DOM element is shown after child elements are updated. 😊 ## ps. LLM (Large Language Model) 이 어떻게 만들어 지는지 공부하고 있는데, 참 신기하고 대단해 보임. Brilliant.org 결제해서 공부하고 있는데 , 확률을 이용하고 Deep Nueral Network 로 모델을 짜서 학습시키면 이런게 가능하다는거 같은데... 사람의 뇌도 이거랑 비슷한건가?란 의문도 들고... 참 신기방기. ## RRA
  1. stackoverflow.com :: parent hidden but children still visible (I don't want them visible)!
  2. https://brilliant.org/courses/how-llms-work/
반응형