JavaScript slidedown without jQuery

前端 未结 11 957
离开以前
离开以前 2020-11-27 14:03

I wish to have a similar effect to jQuery slidedown but without using jQuery or any other libary. I know it\'s \"possible\" as anything in jQuery can be don

11条回答
  •  醉梦人生
    2020-11-27 14:52

    The problem with the earlier answers is you need to know the height before you start. Many times you do not. I built a slid down the you first build a holder div, put the object to ge the slide down inside set the display of the object to block and get the height and use this for the sind. When the side is finished the holder is rmoved do the slide down when done remove it. below is the example.

    
    
        
            
            
        
        
            
     
    slide Up
     
    slide down

提交回复
热议问题