jquery .slideToggle() horizontal alternative?

后端 未结 7 2032
死守一世寂寞
死守一世寂寞 2020-11-28 07:02

slideToggle does exactly what I want, only I want the slide to be horizontal.

I now have an horizontalhide/show and animation on click, but I would like to have the

7条回答
  •  执笔经年
    2020-11-28 07:36

    i tried this, and works great!

    html code:

    The CSS /* flip the pane when hovered */ .flip-container:hover .flipper, .flip-container.hover .flipper { transform: rotateY(180deg); }

    .flip-container, .front, .back {
        width: 320px;
        height: 480px;
    }
    
    /* flip speed goes here */
    .flipper {
        transition: 0.6s;
        transform-style: preserve-3d;
    
        position: relative;
    }
    
    /* hide back of pane during swap */
    .front, .back {
        backface-visibility: hidden;
    
        position: absolute;
        top: 0;
        left: 0;
    }
    
    /* front pane, placed above back */
    .front {
        z-index: 2;
        /* for firefox 31 */
        transform: rotateY(0deg);
    }
    
    /* back, initially hidden pane */
    .back {
        transform: rotateY(180deg);
    }
    

    i use this inside a bootstrap col-sm-* and works great too

     

    Share your emotions

    Share emotions with friends, family and teammates.

    the css

    .content-box
    {
        position: relative;
        text-align: center;
        height: 105px;
        width: 100%;
    }
    .content-box-icon
    {
        font-size: 30px;
        width: 60px;
        height: 60px;
        line-height: 60px;
        border-radius: 50%;
        text-align: center;
        display: block;
        margin: 5px auto 15px auto;
        color: #fff;
        float: none; 
        background:#25acfd                     
    }
    .content-box-front
    {
        z-index: 2;
        /* for firefox 31 */
        transform: rotateY(0deg);
        backface-visibility: hidden;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 105px;
    }
    .content-box-back
    {
        transform: rotateY(180deg);
        backface-visibility: hidden;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 105px;
    }
    /* entire container, keeps perspective */
        /* flip the pane when hovered */
        .flip-container:hover .flipper, .flip-container.hover .flipper {
            transform: rotateY(180deg);
        }
    
    /* flip speed goes here */
    .flipper {
        transition: 0.6s;
        transform-style: preserve-3d;
        position: relative;
    }
    

提交回复
热议问题