How to add display:inline-block in a jQuery show() function?

后端 未结 12 1957
执念已碎
执念已碎 2020-12-02 17:38

I have some code like this:

function switch_tabs(obj) {
    $(\'.tab-content\').hide();
    $(\'.tabs a\').removeClass(\"selected\");

    var id = obj.attr(         


        
12条回答
  •  [愿得一人]
    2020-12-02 18:18

    You can use animate insted of show/hide

    Something like this:

    function switch_tabs(obj)
    {
        $('.tab-content').animate({opacity:0},3000);
        $('.tabs a').removeClass("selected");
        var id = obj.attr("rel");
    
        $('#'+id).animate({opacity:1},3000);
        obj.addClass("selected");
    }
    

提交回复
热议问题