Slide two divs simultaneously

前端 未结 3 630
逝去的感伤
逝去的感伤 2021-01-18 04:29

I\'m trying to have two sections in the same page, a login-section and an app-section.

The idea is onLoginSubmit() to slide out to the left the login-section and sli

3条回答
  •  被撕碎了的回忆
    2021-01-18 04:58

    HTML

    JS

    $(document).ready(function() {
    
    $('#login-section').toggle("slide", { direction: "left" }, 500);
    $('#app-section').toggle("slide", { direction: "right" }, 500);
    
    })
    

    CSS

    #login-section {
            background: red;
            //padding: 20px; 
            width: 100%;
            height: 100%; 
            left : 0;
            top : 0;
            position : absolute;
        }
    
        #app-section {
            background: blue;
            //padding: 20px; 
            width: 100%;
            height: 100%; 
            right:0;
            top : 0;
        }
    

    Please check this Fiddle

提交回复
热议问题