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

后端 未结 12 1971
执念已碎
执念已碎 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:38

    I think you want both the animation and to set the display property at the end. In that case you better use show() callback as shown below

    $("#my_obj").show(400,function() {
        $("#my_obj").css("display","inline-block")
    }) ;
    

    This way you will achieve both the results.

提交回复
热议问题