Accordion control...

I have three accordion controls on a page. The 1st and second one have first section expanded which is okay. The 3rd one also showing its first section expanded.

Question: How can I have the 3rd one collapsed?

<!DOCTYPE html>

    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>
   <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script> 
  <!--<script src="//"></script>  -->
	<link rel="stylesheet" type="text/css" href="./styles/resume.css"/>
        line-height: 50px;
        vertical-align: middle;

      img {


   $(function() {
    $( ".accordion-div" ).accordion({
      heightStyle: "content",collapsible: true
            var headers = $('#accordion h3.ui-accordion-header');
    $('.ui-accordion-header-icon', headers).removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-e');;
<div class="content">

		<div class="btn-group-vertical">
			<a href="index.html" class="btn btn-default">Resume</a>
			<a href="Videos.html" class="btn btn-default">Videos...</a>
			<a href="Projects.html" class="btn btn-default">Projects...</a>
			<a href="certificate.html" class="current btn btn-default">Certificates...</a>
			<a href="more.html" class="btn btn-default">More...</a>

				<div class="btn-group">
					<a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
						<span class="caret"></span>
					<ul class="dropdown-menu">
						<li><a href="resources/Resume_Mike_Eghtebas_March15_2015.docx">Resume.docx</a></li>
						<li><a href="resources/Resume_Mike_Eghtebas_March15_2015.pdf" target="_blank">Resume.pdf</a></li>

	<div class="wrapper">
        <div class="left-col">&nbsp;
		</div> <!-- <div class="left-col"> -->

		<div class="verticalGapTop">&nbsp;</div>

		<div class="right-col nameBlock">
				<span class="name">Mike M Eghtebas</span><br>
				<span class="title">Database Development & Web Programming</span><br>
		</div> <!-- <div class="right-col nameBlock"> -->
		<div class="horizontalGap">&nbsp;</div>   

		<div class="left-colBottom">
		</div> <!-- <div class="left-colBottom"> -->
		<div class="verticalGapBottom">&nbsp;</div>

		<div class="right-colBottom">

			<p class="name"><br>Certificates:</p>
			<div class="accordion-div">
				<div id="accordion" class="accordion-div">
				<h2 class="foo">Microsoft Technology Associate, MTA 98-364</h2>
						MTA Database track, data platyform adminstration and business intelligence.
						Passed on January 2015. <a href="./images/mta.png" target="_blank"><abbr title="Certificate">MTA 98-364</abbr></a>
				<h3>Querying Microsoft SQL Server 2012</h3>
						Querying Microsoft SQL Server 2012<br>
						Recived <a id="A4a" href="./images/certNHZ.png" target="_blank"><abbr title="Certificate of completion">Certificate of Completion</abbr></a>
						for course 20-461 covering: <br>
						Create database objects (tables, views, indexes, constraints, etc.)<br>
						Queries (select, sub-queries, implement data types, aggregate queries, xml data)<br>
						Scheduled to pass Microsoft Exam 70-461 on December 22, 2015.
			</div><!-- <div class="accordion-div"> -->
			<div class="accordion-div">
				<h1>Expert Exchange</h1>
				<div id="accordion2" class="accordion-div">
				<h2 class="foo">Master 50,000 points (count: 11)</h2>
					<li><a href="resources/eeCertificates.pdf#page=15"  target="_blank">1. Programming for ASP.NET </a></li>
					<li><a href="resources/eeCertificates.pdf#page=13"  target="_blank">2. C# Programming Language</a>  </li>
					<li><a href="resources/eeCertificates.pdf#page=16"  target="_blank">3. VB.NET Programming</a> </li>
					<li><a href="resources/eeCertificates.pdf#page=12"  target="_blank">4. .NET</a> </li>
					<li><a href="resources/eeCertificates.pdf#page=14"  target="_blank">5. MS SQL Server</a></li>
					<li><a href="resources/eeCertificates.pdf#page=17"  target="_blank">6. MS SQL Server 2008 Access</a></li>
					<li><a href="resources/eeCertificates.pdf#page=10"  target="_blank">7. SQL Query Syntax</a></li>
					<li><a href="resources/eeCertificates.pdf#page=9"  target="_blank">8. Access Coding/Macros</a></li>
					<li><a href="resources/eeCertificates.pdf#page=8"  target="_blank">9. Access Forms</a></li>
					<li><a href="resources/eeCertificates.pdf#page=11"  target="_blank">10. Access Reports</a></li>
					<li><a href="resources/eeCertificates.pdf#page=7"  target="_blank">11. Microsoft Access Database</a></li>
				<h2 class="foo">Guru 150,000 points (count: 3)</h2>
					<li><a href="resources/eeCertificates.pdf#page=4"  target="_blank">12. Microsoft Access Database</a></li>
					<li><a href="resources/eeCertificates.pdf#page=5"  target="_blank">13. Access Forms</a></li>
					<li><a href="resources/eeCertificates.pdf#page=6"  target="_blank">14. Access Coding/Macros</a></li>
				<h2 class="foo">Wizard 300,000 points  (count: 1)</h2>
					<li><a href="resources/eeCertificates.pdf#page=3"  target="_blank">15. Microsoft Access Database</a></li>

				<h2 class="foo">Sage 500,000 points (count: 1)</h2>
					<li><a href="resources/eeCertificates.pdf#page=2"  target="_blank">16. Microsoft Access Database</a></li>
				<h2 class="foo">Genius 1,000,000 points (count: 1)</h2>
					<li><a href="resources/eeCertificates.pdf#page=1"  target="_blank">17. Microsoft Access Database</a></li>
			</div><!-- <div class="accordion-div"> -->
		  <!--<a id="SampelEEQA"></a><br/><br/>-->
		  <div class="accordion-div">
				<h1>Sample questions I have answered at online</h1>
				<div id="accordion3" class="accordion-div">
				<li><a href=""  target="_blank">SQL Update Query</a></li>
				<li><a href=""  target="_blank">User control event firing multiple times c#</a></li>
				<li><a href=""  target="_blank">SQL Server 2008 R2 - Strip most all text but keep specific text</a></li>
				<li><a href=""  target="_blank">MVC - combining two field in a drop down from joint table</a></li>
				<li><a href=""  target="_blank">Mysql, ordering results by the highest score (inner query)</a></li>
				<li><a href=""  target="_blank">Values only change when i use the mouse</a></li>
				<li><a href=""  target="_blank">SQL Query Syntax</a></li>
				<li><a href=""  target="_blank">Access 2003 query, long list of "or" not working</a></li>
				<li><a href=""  target="_blank">SQL Script help</a></li>
				<li><a href=""  target="_blank">Link two temp tables to get a result set</a></li>
				<li><a href=""  target="_blank">How to Club Rows in One Row As Others - SQL Server</a></li>
				<li><a href=""  target="_blank">Select first occurrence of record in SQL Server</a></li>
				<li><a href=""  target="_blank">TRIM ; out of a text Field</a></li>
				<li><a href=""  target="_blank">find duplicate column within a group</a></li>
				<li><a href=""  target="_blank">Insert Record if no records found - SQL</a></li>
				<li><a href=""  target="_blank">TOP N BY GROUP</a></li>
				<li><a href=""  target="_blank">IIF to include Null Values from Table</a></li>
				<li><a href=""  target="_blank">How to remove, then re-add table constrain</a></li>
				<li><a href=""  target="_blank">sql DateDiff help</a></li>
				<li><a href=""  target="_blank">T-SQL CTE for finding Parent, Prior Peer, Next Peer, Child</a></li>
				<li><a href=""  target="_blank">SQL 2005 - Exclude records from Select</a></li>
				<li><a href=""  target="_blank">SQL Server Transpose , partially at least</a></li>
				<li><a href=""  target="_blank">User Defined Function</a></li>
			</div><!-- <div class="accordion-div"> 
		  <!--	-->
		</div> <!-- <div class="right-colBottom"> -->
	</div> <!-- <div class="wrapper"> -->

	<div class="footer"> 
        <div class="note"><span>September 2015 update, single page</span> </div>
		<div class="cssLogo"><img style="border:0;width:44px;height:15px" src=""  alt="Valid CSS!" /> </div>

</div><!-- <div class="content"> -->

Open in new window

html edited for the 3rd control
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?

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

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.

Rainer JeschorCommented:
here we go - simply replace your (function ...) completely with this:
   $(function() {
    // open all but the last two
    $( ".accordion-div" ).slice(0,-2).accordion({
      heightStyle: "content",
	  collapsible: true
	// Set active state false for the last two accords
	$( ".accordion-div" ).slice(-2).accordion({
      heightStyle: "content",
	  collapsible: true,
	  active: false

Open in new window


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
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Thank you.
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

From novice to tech pro — start learning today.