I'm trying to get some classes to be added/removed on the show/hide of a 
collapse div.

The code I have is this:
<html>
...snip...
<button type="button" class="btn" data-toggle="collapse" 
data-target="#prevbands" id="bandsbutton">Previous Bands <span 
id="bandsicon" class="icon icon-chevron-down"></span></button>
<div class="collapse" id="prevbands">
...ship...

<js>
$('#prevbands').on('show', function () { 
  var buttonstate = $('#bandsicon');
  var barstate = $('#bandsbutton'); 
 buttonstate.removeClass('icon-chevron-down').addClass('icon-white 
icon-chevron-up');
 barstate.addclass('ldcolour'); 
   }); 
$('#prevbands').on('hide', function () {
  var buttonstate = $('#bandsicon');
  var barstate = $('#bandsbutton'); 
 buttonstate.removeClass('icon-white 
icon-chevron-up').addClass('icon-chevron-down');
 barstate.removeclass('ldcolour'); 
   }); 

Without my extra js it works fine (ie, showing/hiding the content inside 
collapse). But, when I put it in, the icon is changed but the div doesn't 
open. Ideas?

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"twitter-bootstrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to