How to do a slide animation between two Bootstrap 3 tabs?

前端 未结 3 728
温柔的废话
温柔的废话 2020-12-15 10:59

I\'m trying to figure out how to do a slide left, right, up, down between two Bootstrap 3 tabs.
I have searched the web and surprisingly have not found anything.
Th

3条回答
  •  情歌与酒
    2020-12-15 11:20

    There is better way I have used in my last project. Its Animate.css

    1. Very Easy
    2. More Effects

    JavaScript

    function leftSlide(tab){
       $(tab).addClass('animated slideInLeft');
    }
    
    function rightSlide(tab){
       $(tab).addClass('animated slideInRight');   
    }
    
    $('li[data-toggle="tab"]').on('shown.bs.tab', function (e) {  
        var url = new String(e.target);
        var pieces = url.split('#');
        var seq=$(this).children('a').attr('data-seq');
        var tab=$(this).children('a').attr('href');
        if (pieces[1] == "profile"){       
         leftSlide(tab);        
        }
    })
    

提交回复
热议问题