So I am using bootstrap and have collapse panels I wish to implement plus and minus icons.
I have currently done it using the code below found on stackoverflow, i can't remember the link so will edit later. It uses the code below however I have to duplicate it for each group of collapse panels as they have a unique id. Is there a way to it so it's only required once and will work on multiple on the same page?
jQuery(function ($) {
var $active = $('#accordionthree .panel-collapse.in').prev().addClass('active');
$active.find('.symbol').append('<span class="glyphicon glyphicon-minus pull-left"></span>');
$('#accordionthree .panel-heading').not($active).find('.symbol').prepend('<span class="glyphicon glyphicon-plus pull-left"></span>');
$('#accordionthree').on('show.bs.collapse', function (e)
{
$('#accordionthree .panel-heading.active').removeClass('active').find('.glyphicon').toggleClass('glyphicon-plus glyphicon-minus');
$(e.target).prev().addClass('active').find('.glyphicon').toggleClass('glyphicon-plus glyphicon-minus');
});
$('#accordionthree').on('hide.bs.collapse', function (e)
{
$(e.target).prev().removeClass('active').find('.glyphicon').removeClass('glyphicon-minus').addClass('glyphicon-plus');
});
});
I am trying to import svg image from file into next.js component. In assets folder I have google.svg(icon): <svg className="svgIcon-use" width="25" height="37" viewBox="0 0 25 25"> <g ...
I am trying to import svg image from file into next.js component. In assets folder I have google.svg(icon): <svg className="svgIcon-use" width="25" height="37" viewBox="0 0 25 25"> <g ...
I have a video gallery with thumbnails. when I click on a thumbnail a video shows up. how can I stop/reset video that's playing when I click on another thumbnail? here is the code I have function ...
I have a video gallery with thumbnails. when I click on a thumbnail a video shows up. how can I stop/reset video that's playing when I click on another thumbnail? here is the code I have function ...
I am trying to print array element to console using for each loop in javascript. But I am printing something which I am not able to figure out what! let arr=["1,2,3","iosajah","undefined"]; for(...
I am trying to print array element to console using for each loop in javascript. But I am printing something which I am not able to figure out what! let arr=["1,2,3","iosajah","undefined"]; for(...
Assuming I have this list const foo = [ { id: 1, bar: [ {id: 1, a: null}, {id: 2, a: 224}, {id: 3, a: 345}, ] }, { id: 2, bar: [ {id: 4, a: 763}, {id: 5, a: null}, {id: 3, a: ...
Assuming I have this list const foo = [ { id: 1, bar: [ {id: 1, a: null}, {id: 2, a: 224}, {id: 3, a: 345}, ] }, { id: 2, bar: [ {id: 4, a: 763}, {id: 5, a: null}, {id: 3, a: ...