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

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

    Razz's solution would work for the .hide() and .show() methods but would not work for the .toggle() method.

    Depending upon the scenario, having a css class .inline_block { display: inline-block; } and calling $(element).toggleClass('inline_block') solves the problem for me.

提交回复
热议问题