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.