siannone siannone - 1 year ago 62
Javascript Question

Twitter Bootstrap hide css class and jQuery

I'm using the hide css class to hide a button on page load.

The problem is that when i try to show the button i've previuosly hidden with jQuery the button is smaller.

(the same thing doesn't happen when i use jQuery to hide and then show the button)

Thanks for helping.

Edit: hide class is just this:

.hide {
display: none;

My button:

<a class="btn hide" id="buttonEditComment" href="javascript:void()"><i class="icon-comment"></i> Edit comment</a>

Javascript i use to show the button:


Answer Source

As dfsq said i just had to use removeClass("hide") instead of toggle()