The Youtube video in my hidden DIV only starts to load after the DIV is shown

后端 未结 3 1173
自闭症患者
自闭症患者 2021-01-06 03:51

I have a Youtube clip in a hidden DIV on my page.

After the page has loaded I wanted the video to load quietly in the background so that when the user clicks the but

3条回答
  •  耶瑟儿~
    2021-01-06 04:25

    Yep. Use visibility:hidden instead of display:none. display:none means that the element isn't rendered as part of the DOM, so it's not loaded until the display property changes to something else. visibility:hidden loads the element, but does not show it.

    Try this:

    
        
        
        
        Untitled Document
            
           
    
        
    
        
    
        
        
    
    
        
        
    

提交回复
热议问题