How to Hide DIVs, they are Showing for a Split Second on page Load

后端 未结 5 1822
陌清茗
陌清茗 2021-01-05 19:19

I have made a very quick jQuery slideshow, and I\'m using this to hide the DIVs which shouldn\'t be shown until it\'s their turn:

$(document).ready(function(         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 19:37

    Disabling in CSS is fine, but then users without JS will never see them.

    To disable for users with JS only, mark the body and appropriate CSS:

    
      
    

    CSS:

    .js #gall2, .js #gall3, .js #gall4 { display: none; }
    

提交回复
热议问题