Panels not Collapsing After Another Panel is opened

if one panel body is open all other panel body should close if they are in open position.
kumar naikGraphic DesignerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
Show us your code so we can take a look
0
kumar naikGraphic DesignerAuthor Commented:
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Budget 2018</title>
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  	<script type="text/javascript">
  		$(document).ready(function(e){
  			$(".glyphicon").click(function(e){
  				$(this).toggleClass("glyphicon-plus glyphicon-minus");
  				$(this).closest('.panel-heading').next('.panel-body').toggle();

  			});
  			
  		});
  	</script>
</head>
<body>
	<div class="container-fluid">
		<div class="panel-group">
			<div class="panel panel-default">
				<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Key Highlights from Budget 2018</label></div>
					<div class="panel-body collapse">Finance Minister Arun Jaitley's delivered his fifth and last full Budget amid subdued economic growth, challenging fiscal situation and farm distress. What makes it all the more important is the upcoming elections in eight states this year and the Lok Sabha election next year, all of which put tough demands on him. How has Jaitley managed to balance populist demands, the need to support economic growth and Prime Minister Narendra Modi's focus on fiscal discipline and reforms? Read the highlights</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Fiscal Situation</label> </div>
					<div class="panel-body collapse"><div> Fiscal deficit is 3.5% of GDP at Rs 5.95 lakh crore in 2017-18. Projecting fiscal deficit to be 3.3% of GDP in the next fiscal </div>
					<div>* Rs 21.57 lakh crores transferred as net GST to states as against projection of Rs 21.47 lakh crores.</div> 
					</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Income Tax</label></div>
					<div class="panel-body collapse">
							NoChange in personal Incometax slab rates
							Standard deduction of Rs 40,000 for medical expenses for salaried Class
							Senior Citizens get Rs 50,000 Exemption for medical insurance
							Senior Citizens get Rs 10,000 Exemption in Income from FD'S
							* 85.51 lakh new tax payers filed income tax returns in FY17 
							* NO PERSONAL INCOME TAX CHANGES PROPOSED IN BUDGET 
							* Growth in direct taxes (till Jan 15) is 18.7 % 
							* Surcharge of 10 pc on income above Rs 50 lakh but less than Rs 1 cr to be continued next year; 15 pc on income above Rs 1 cr to also continue.
							* 100% tax deduction is allowed to co-operative societies
					</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Corporate Tax</label></div>
					<div class="panel-body collapse">
						Corporate Tax of 25% extended to companies with turnover up to Rs 250 cr in financial year 2016-17
						* Incentives for Senior citizens: Exemptions in income of Rs 10,000 from Banks FD and post offices 
						* Senior citizens to get Rs 50,000 per annum exemption for medical insurance under Sec 80D 
						* Rs 7.5 lakh per senior citizen limit for investment in interest-bearing LIC schemes doubled to Rs 15 lakh 
						* Standard deduction of Rs 40,000 allowed for transport, medical reimbursement for salaried tax payers 
						* Govt to reduce hardships faced in realty deals; no adjustment to be made in case circle rate does not exceed 5 pc of sale consideration 
						* Rs 8,000 crore revenue lost due to standard deduction allowed to salaried employees 
						* Rs 7,000 cr revenue forgone on account of lower corporate tax for Rs 250 cr turnover cos 
						* Rs 19,000 cr revenue loss on direct tax in last fiscal 					
					</div>
				</div>
				<div class="panel panel-default">
						<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>LONG TERM CAPITAL</label></div>
						<div class="panel-body collapse">
							LONG TERM CAPITAL GAINS EXCEEDING RS 1 L AKH WILL BE TAXED AT 10% WITHOUT INDEXING
							* Short term capital tax remains at 15% 
							* A tax on distributed income at 10% 
							* Education cess increased to 4 pc from 3 pc to collect additional Rs 11,000 cr 
							* GST revenue will be received only for 11 months, that will have an effect on balance sheets 
							* GST collections projection pegged at Rs 7.43 lakh crore in full year 2018-19 as against Rs 4.44 lakh crore in nine months of current fiscal. 
							* Govt makes PAN mandatory for any entity entering into a financial transaction of Rs 2.5 lakh or more. 
						</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Imports and Exports</label></div>
						<div class="panel-body collapse">* Customs Duty on certain products, such as mobile phones and televisions has been increased, to provide a fillip to 'Make in India' 
						* Social welfare surcharge of 10% on imported goods. 
						* Central Board of Excise and Customs renamed as Central Board of Indirect Taxes and Customs 
						</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Agriculture</label></div>
				<div class="panel-body collapse ">
				jai kisan
				Agriculture market fund of Rs. 2,000 Crore.
				Kharif MSP at 1.5 times produce Price.
				food Processing Sector Allocation almost double for Rs 1400 Cr.
				Rs 10,000. Crore for Fisheries and Aquaculture, animal husbandry funds.
				Rs 500 cr for Operation Green.
				* The government's emphasis will be on generating higher incomes for farmers, by helping them produce more with lesser cost, and in turn, earn higher income for their produce. 
				* Jaitley stressed on the fact that India's agricultural production is at a record high level today. 275 million tonne foodgrains and 300 million tonne fruits and vegetable have been produced in the country. 
				* The FM said the government wants farmers to earn 1.5 times the production cost, and the Minimum Selling Price (MSP) for the Kharif Crops has been set at 1.5 times the produce price. Jaitley said the Centre will work with states to ensure that all farmer get a fair price. 
				* Agricultural market and infra fund of Rs 2000 crore fund will be set up to strengthen the market connectivity. 
				* A sum of Rs 500 cr will be allocated for Operation Green to be launched. It will promote agricultural products. 
				* Extend the facility of Kisan credit card to fisheries and for animal husbandry 
				* Rs 10,000 crore set aside for Fisheries and Aquaculture Development Fund 
				* Rs 10,000 crore set aside for animal husbandry infra fund 
				* Propose to launch a restructured bamboo mission with a fund of Rs 1200 crore . "Bamboo is green gold," Jaitley said. 
				* Agricultural credit target increased from Rs 8.5 lakh crore to Rs 11 lakh core 
				* Special scheme to manage crop reduce in Haryana, Punjab and Delhi to reduce pollution 
				</div>
			</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Rural Economy</label></div>
					<div class="panel-body collapse">
						* 8 crore poor women will get new LPG connections. 
						* PM Saubhagya Yojana: 4 crore poor people will get power connection. 
						* The government will spend Rs 16,000 crore on this scheme. 
						* Govt plans to construct 2 crore toilets in next fiscal year under Swach Bharat Mission 
						* Government target house for all by 2022. 51 lakh houses have been constructed affordable houses in rural and further 50 lakh houses in urban areas. 
						* 1 cr houses to be built under Pradhan Mantri Awas Yojana in rural areas 
						* National livelihood scheme gets Rs 5,750 crore . 
						* In 2018-19, ministries will be able to spend Rs 14.34 lakh crores for creation of livelihood in rural areas. 
						* Govt gives Rs 9,975 crore for social security schemes for the next fiscal year. 
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Education</label></div>
						<div class="panel-body collapse">
						Rs 1 lakhs Cr to revitalise and upgrade education Sector.
						EklavyaSchools by 2022 for blocks with above 50% ST population.
						Black board to digital board schools by 2022
						1000PM Research Fellows Every Year.
						* Govt to increase digital intensity in education. Technology to be the biggest driver in improving quality of education: FM Jaitley 
						* Rs. 1 lakh crore allocated to revitalisation and upgradation of education sector. Promoting learning based outcomes and research. 
						* By 2022, every block with more than 50 per cent ST population will have Ekalvya schools at par with Navodaya Vidyalayas 
						* Aims to move from black board to digital board schools by 2022. 
						* PM reasearch fellows: Govt will identify 1000 Btech students each years and provide them to do PHDs in IIT and IISc, while also teaching undergraduate students once a week at that time. 
						</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Health</label></div>
						<div class="panel-body collapse">
							Rs 5 lakh medical insurance cover per year for 10 crore Families.
							Pledges 1 medical college  for every 3 parlimentary constituencies.
							* Aayushman Bharat programme: 1.5 lakh centres will be set up to provide health facilities closer to home. Rs 1,200 crore to be allocated for this programme 
							* Flagship National Healthcare protection scheme, with approximately 50 crore beneficiaries. Up to Rs 5 lakh per family per year for secondary and tertiary care hospitalisation. World's largest government-funded healthcare programme. 
							* Universal health coverage will be expanded after seeing the performance of the scheme 
							* Rs 600 crore allocated for tuberculosis patients, at the rate Rs 500 per month during the course of their treatment. 
							* Jaitley announces setting up of one medical college for every three parliamentary constituencies, with 24 New government medical colleges also being envisioned. Government also will work on upgrading hospitals to medical colleges 
						</div>
				</div>
					<div class="panel panel-default">
						<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Social Security</label></div>
							<div class="panel-body collapse">* PM Jivan Bhma Yojana has benefited 5.22 crore families 
							* Govt will expand PM Jan Dhan Yojana: Al 16 crore accounts will be included under micro insurance and pension schemes 
							* 1.26 cr accounts opened under Sukanya Samriddhi Scheme 
							* Social inclusion schemes for Scheduled Castes - Rs 52,719 crore 
							* Social inclusion schemes for Scheduled Tribes Rs 39,139 crore 
						</div>
					</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>MSME</label></div>
					<div class="panel-body collapse">* Rs 3,794 crore allocated to the MSME sector in the form of capital support and interest subsidy By 2022, every block with more than 50 per cent ST population will have Ekalvya schools at par with Navodaya Vidyalayas 
					* Rs 3 lakh crore target has been set for the Mudra Yojana 
					* Rs 4.6 lakh cr sanctioned under MUDRA Scheme </div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Petroleum/ Diesel Sector </label></div>
					<div class="panel-body collapse">
					* Excise on unbranded diesel cut by 2 rupees to 6.33 rupee/ltr 
				    * Excise on unbranded petrol cut by 2 rupees to 4.48 rupee/ltr </div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Employee-centric schemes </label></div>
					<div class="panel-body collapse">
						* Govt will contribute 12% of the wages of new employees in EPF in all sectors for next 3 years 
						* Women contribution to EPF reduced to 8% for first 3 years 
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Infrastructure</label></div>
					<div class="panel-body collapse">
						Roads and Highways To develop 35,000 km Under Phase 1 as part of Bharatmala project.
						Rs 5.35  lakhs Crore
						* India needs investment of Rs 50 lakh crore in the infrastructure sector 
						* Construction of new tunnel in Sera Pass to promote tourism 
						* Out of 100 smart cities 99 cities have been selected, with an outlay of Rs 2.04 lakh crore 
						* 10 prominent tourist sites will be made iconic tourist destinations, with an amalgamation of private funding, marketing and branding 
						* Bharatmala project: To develop 35,000 KM under phase 1 with an outlay of Rs 5.35 lakh crore 
						* Govt to introduce pay-as-you-use system for toll payments 
						
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Railways</label></div>
						<div class="panel-body collapse">
						Rail Budget.
						Railway Capex pegged at Rs 1.48 lakhs Cr
						Govt to Eliminate 4267 unmanned rail crossing in 2 years.
						All station with 25,000+footfalls to have escalators.
						11000 cr for mumbai rail network,Rs 17,000Cr for bangaluru metro.
						* Railway capex has been pegged at Rs 1.48 lakh crore , up from Rs 1.31 lakh crore last year 
						* Eliminate unmanned railway crossing 
						* All stations with footfall of greater than 25,000 will have escalators. 
						* More stations and trains will progressively be built with WiFi and CCTV camera 
						* Govt to eliminate 4267 unmanned rail crossing in broad gauge in 2 years 
						* Allocates Rs 11,000 crore Mumbai rail network and Rs 17,000 crore for the Bengaluru metro
						* 150 km of additional suburban railway networks to be set up in Bengaluru at the cost of Rs 17,000 cr. 
						</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Aviation</label></div>
					<div class="panel-body collapse">
						To expand airport capacity to 5 timesto 1 bn trips a year.
						Rs60 crore allocated to kickstart initiative.
						Udan scheme to connect 64 unconnected air ports.
						* Airport Authority of India (AAI) has 124 airports. Propose to increase the number by at least 5 times 1 billion trips a year, Rs 60 cr has been allocated to kickstart the initiative 
						* UDAN Scheme to connect 64 unconnected airports across the country 
					</div>
				</div>
					<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Markets </label></div>
					<div class="panel-body collapse">
					* Govt to take additional measures to strengthen environment for venture capitalists and angel investors. 
					* SEBI to consider mandating large corporations to meet 1/4th of their debt needs 
					* SEBI to mull asking large cos to meet 25% debt from bond market
					* RBI norms to nudge companies to access bond market for funds 
					</div>
					</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Technology</label></div>
						<div class="panel-body collapse">
							* Allocation to Digital India scheme doubled to Rs 3073 cr 
							* 5 lakh WiFi HotSpots to provide Broadband access to 5 crore rural citizens, at the cost of Rs 10,000 cr. 
							* Government will take measures to stop cryptocurrency circulation, as it is not considered legal tender 
							* Government will explore the usage of Blockchain technology. 
						</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span>
						<label>Companies </label>
					</div>
					<div class="panel-body collapse">
						* AADHAAR FOR CORPORATES? Govt will evolve a scheme to assign a Unique ID for cos 
						* Disinvestment target of Rs 80,000 crore for FY19 
						* National Insurance Co, Oriental Insurance Co and United Assurance Co to be merged into one entity and subsequently listed 
						* Govt revises divestment target for the current fiscal to Rs 1 lakh crore for FY 18. 
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Banking</label></div>
					<div class="panel-body collapse">* Recapitalisation will pave the way for public banks to lend an additional Rs 5 lakh crore</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Industries </label></div>
					<div class="panel-body collapse">* Rs 7,148 cr allocated for textile sector </div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Miscellaneous</label></div>
					<div class="panel-body collapse">
						* Defence outlay raised to Rs 2.82 lakh crore in 2018-19 from Rs 2.67 lakh crore in current year 
						* Food subsidy to rise to Rs 1.69 lakh crore in 2018-19 from Rs 1.4 lakh crore in current year. 
						* Emoluments for President set at Rs 5 lakh, Rs 4 lakh for Vice President, Rs 3.5 lakh for governors 
						* Emoluments for Parliamentrians: Law for increase in pay based on index to inflation 
						* Govt earmarks Rs 150 cr to commemorate 150 years of birth of Mahatma Gandhi </div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>What's costlier and what's cheaper?</label></div>
					<div class="panel-body collapse">
						Here are the details from Arun Jaitley's Budget 
						It's the perennial question after every Budget: What's cheaper and what's going to pinch me. A decent chunk of imported items including mobile handsets, cars and motorcycles, fruit juices, perfumes and footwear will become costlier as the Finance Minister Arun Jaitley hiked customs duties on these products in his Budget. 
						However, select items such as imported raw cashew nuts, solar tempered glass and raw materials and accessories of cochlear implants will become cheaper with the government today reducing import duties on these items. 
						Become costlier: 
						* Cars and motorcycles 
						* Mobile phones 
						* Silver 
						* Gold 
						* Vegetable, fruit juices, including orange and cranberry 
						* Sunglasses 
						* Miscellaneous food preparations other than soya protein 
						* Perfumes and toilet waters 
						* Sunscreen, suntan, manicure, pedicure preparations 
						* Preparations for oral dental hygiene, denture fixative pastes and powders; dental floss 
						* Pre-shave, shaving or after-shave preparations, 
						* Deodorants, bath preparations, depilatories, perfumery 
						* Scent sprays and similar toilet sprays 
						* Truck and Bus radial tyres 
						* Silk Fabrics 
						* Footwear 
						* Coloured gemstones 
						* Diamonds 
						* Imitation jewellery 
						* Smart watches/wearable devices 
						* LCD/ LED TV panels 
						* Furniture 
						* Mattresses 
						* Lamps 
						* Wrist watches, pocket watches, clocks 
						* Tricycles, scooters, pedal cars, wheeled toys, dolls' carriages, dolls, toys, puzzles of all kinds 
						* Video game consoles 
						* Articles and equipment for sports or outdoor games, swimming pools and paddling pools 
						* Cigarette and other lighters, candles 
						* Kites 
						* edible/vegetable oils such as olive oil, groundnut oil 
						cheaper:
						* Raw cashew nuts 
						* Solar tempered glass or solar tempered glass used for manufacture solar panels/modules 
						* Raw materials, parts or accessories used in making cochlear implants 
						* Select capital goods and electronics such as ball screws and linear motion guides. 
					</div>
				</div>
		<div class="panel panel-default">
		<div class="panel-heading"><span class="glyphicon glyphicon-plus"></span>
					<span class="glyphicon glyphicon-minus" style="display: none;"></span><label>Budget 2018 decoded: 15 goods, 3 bads and one uglyArun Jaitley(FM)</label></div>
		<div class="panel-body collapse">
		The Good 
		1. Minimum support price for Kharif crops hiked by 1.5 times 
		2. No TDS for senior citizens on FDs and post office deposits upto Rs 50,000. 
		3. Rise in custom duty on mobile phones from 15% to 20%. Thsi will help domestic manufacturers. 
		4. Standard deduction of Rs 40000 for salaried people 
		4. No legal status for crypto-currencies. 5. Package worth Rs 7100 crore for the textile sector. 
		6. The government to contribute 12% of wages for new employees for Employee Provident Fund. 
		7. Free gas connection for 8 crore poor women under Ujwala scheme. 
		8. Lower tax rate of 25 per cent to companies with a reported turnover up to Rs 250 crore. 
		9. 100% tax deduction to companies registered as farmer-producer companies with turnover of Rs 100 crore. 
		10. Infrastructure outlay increased from Rs 4.94 lakh crore to almost Rs 6 lakh crore. 11. Expansion in airport capacity by five times To handle 1 billion passengers. 
		12. Elimination of 4,267 unmanned rail crossings at broad gauge network. 
		13. Rs 56,000 crore for SCs and Rs 39,000 crore for STs. 
		14. Ayushman Bharat Programme. Rs 5 lakh/year per family for 10 crore families for health expenses. 
		15. Deduction for senior citizens increased to Rs 50,000 for medical insurance. 

		The bad 
		1. No change in personal income taxes. The middle class had expected change in tax slabs while others had expected raising of exemption limit. 
		2. The government has opted for wider fiscal deficit at 3.5 per cent of GDP for 2018-19 and projected 2018-19 deficit at 3.3 per cent of GDP. Higher fiscal deficit not good for government credibility and FDI among other things. 
		3. No tax cut for big corporates which could have helped revive private investment as well as create more jobs. 

		The ugly 
		Finance Minister proposes to tax long-term capital gains upto Rs 1 lakh at 10%. </div>
		</div>
</div>


</div>


		
		
</body>
</html>

Open in new window

0
Chris StanyonWebDevCommented:
OK. You could explicity hide all the panels before showing your new one:

$(document).ready(function(e){
    $(".glyphicon").click(function(e){
        $('.panel-body').hide(); // hide all the panels first.
        $(this).toggleClass("glyphicon-plus glyphicon-minus");
        $(this).closest('.panel-heading').next('.panel-body').toggle();
    });
});

Open in new window

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

kumar naikGraphic DesignerAuthor Commented:
panel body is hiding when other panel is opened but hiding panel does not show glyphicon-plus it is showing glyphicon-minus only
0
Chris StanyonWebDevCommented:
OK. You'll need a slightly different jQuery call, but you will also need to make a change to your HTML. So have some extra <span> elements in your code that you don't need. All the hidden spans with the glyphicon-minus need to be removed:

<span class="glyphicon glyphicon-minus" style="display: none;">

They serve no purpose and slightly mess up your HTML strucure. Once you've removed them, the code you need looks like this:

$(".glyphicon").click(function(e){
    if ($(this).hasClass('glyphicon-plus')) {
        $('.glyphicon-minus').toggleClass("glyphicon-plus glyphicon-minus").closest('.panel-heading').next('.panel-body').toggle();
    }

    $(this).toggleClass("glyphicon-plus glyphicon-minus");
    $(this).closest('.panel-heading').next('.panel-body').toggle();
});

Open in new window

You can see a working demo here -> https://jsfiddle.net/ChrisStanyon/9v2oah3L/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kumar naikGraphic DesignerAuthor Commented:
perfect answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.