Reputation: 1103
I am exactly following the documentation of Bootstrap 3 collapse events side. but still , Browser gives me Uncaught ReferenceError: $ is not defined
in Console , and panel does not change its glyphicon class , now problem was just about changing glyphicon class with me but , when i copied code to jsfiddle , now the panel is not even collapsing on it , i don't know what's going on any help?
Updated:
Upvotes: 0
Views: 273
Reputation: 5211
You need to raise click event for collapsible div id.
$(function() {
$('#collapse-prob-single').on('shown.bs.collapse', function() {
$(".glyphicon").addClass('glyphicon-collapse-up').removeClass('glyphicon-collapse-down');
});
$('#collapse-prob-single').on('hidden.bs.collapse', function() {
$(".glyphicon").addClass('glyphicon-collapse-down').removeClass('glyphicon-collapse-up');
});
});
Demo:
https://jsfiddle.net/v95334q0/5/
Upvotes: 1