JSFiddle - React, Tailwind, and code Playground
HTML
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion-1">What Makes AdvancedMD Different?</a>
<div id="accordion-1" class="accordion-section-content">
<ul>
<li>Ak-Chin Southern Dunes</li>
<li>Antelope Hills- North</li>
<li>Antelope Hills- South</li>
<li>Arizona Grand Resort</li>
<li>ASU Karsten</li>
<li>Augusta Ranch</li>
<li>Camelback- Ambiente</li>
<li>Camelback- Padre</li>
<li>Coldwater Golf Club</li>
<li>Continental Golf Club</li>
<li>Continental Country Club</li>
<li>Copper Canyon Golf CLub</li>
<li>Coyote Lakes Golf CLub</li>
<li>Eagle Mountain</li>
<li>Golf Club at Estrella</li>
<li>Grayhawk Golf Club- Raptor</li>
<li>Grayhawk Golf Club- Talon</li>
<li>Kokopelli</li>
<li>Legend at Arrowhead</li>
<li>Lone Tree Golf Club</li>
<li>Longbow Golf Club</li>
<li>Lookout Mountain Golf Club</li>
<li>McDowell Mountain Golf Club</li>
<li>Palm Valley- Lake</li>
<li>Papago Golf Course</li>
<li>Poston Butte Golf Club</li>
<li>Quintero Golf Club</li>
<li>Raven Golf Club Phoenix</li>
<li>San Marcos Golf Resort</li>
<li>Scottsdale Silverado</li>
<li>Sedona Golf Resort</li>
<li>Starfire Golf Club</li>
<li>Stonecreek Golf Club</li>
<li>Sunland Springs Village</li>
<li>Supersitition Springs Village</li>
<li>Superstition Springs Golf Club</li>
<li>Talking Stick- North</li>
<li>Talking Stick- South</li>
<li>The Phoenician</li>
<li>The Westin Kierland Resort</li>
<li>TPC® Scottsdale- Champions</li>
<li>TPC® Scottsdale- Stadium</li>
<li>Trilogy at Vistancia</li>
<li>Troon North- Monument</li>
<li>Troon North- Pinnacle</li>
<li>Verrado Golf Club</li>
...
CSS
.accordion,
.accordion * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.accordion {
/*box-shadow:0px 1px 3px rgba(0,0,0,0.25); Comment out by HS support 4/13/17 */
border-radius: 3px;
background: #ffffff;
position: absolute;
}
/*----- Section Titles -----*/
.accordion-section-title {
width: 100%;
padding: 5px;
display: inline-block;
border-radius: 15px 15px 15px 15px;
/*15px 15px 15px 15px; HS SUPPORT*/
border-bottom: 1px solid #1a1a1a;
background: #29cdcb;
transition: all linear 0.15s;
/* Type */
font-size: 1.200em;
font-weight: bold;
text-align: center;
text-shadow: 0px 1px 0px #1a1a1a;
color: #fff;
text-decoration: none;
}
.accordion-section-title.active,
.accordion-section-title:hover {
background: #800000;
color: #fff;
/* Type */
text-decoration: none;
}
.accordion-section:last-child .accordion-section-title {
border-bottom-color: white;
padding-bottom: 2px;
}
/*----- Section Content -----*/
.accordion-section-content {
height: 500px;
overflow: scroll;
padding: 0px;
display: none;
}
/*remove if you want bullet points */
.accordion-section-content ul{
list-style:none;
}
JavaScript
$(document).ready(function() {
function close_accordion_section() {
$('.accordion .accordion-section-title').removeClass('active');
$('.accordion .accordion-section-content').slideUp(300).removeClass('open');
}
$('.accordion-section-title').click(function(e) {
// Grab current anchor value
var currentAttrValue = $(this).attr('href');
if ($(e.target).is('.active')) {
close_accordion_section();
} else {
close_accordion_section();
// Add active class to section title
$(this).addClass('active');
// Open up the hidden content panel
$('.accordion ' + currentAttrValue).slideDown(300).addClass('open');
}
e.preventDefault();
});
});