Search code examples
jquerytwitter-bootstrapslidetoggleclass

How to hide button from slide?


I'm having trouble to figure out how to solve problem with jQuery slide using togggleclass.

I have a page that have two columns using has (two square box) in Bootstrap and show one full wide box. There is button inside or outside of box, that allow me to click button to slide using CSS toggleclass and show two columns (two boxes) from one box, and show same button in second column, and if I want to click button again from second column it will back to show full wide box.

My question is that how can I get ride or hide the button after click the button from second column before show full wide!

Please see sample at jsfiddle

and I put jQuery code like this:

$('#trig').on('click', function () {
    $('#col1').toggleClass('span12 span3');
    $('#col2').toggleClass('span0 span9');
    $('.#trig').hide();
});

does any one know how can I hide that button after click the same button from second column to go back to wide full one box!

thanks.


Solution

  • You have there typo Here is working solution: jsfiddle

    Its $('#trig').hide(); not $('.#trig').hide();