- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在处理一个刚刚添加了 Accordion 的页面。它有几个不同的 Accordion ,当单击其中任何一个时,所有 Accordion 都会打开。再次单击 Accordion 时,它应该折叠,但它似乎只是重新加载代码并保持所有 Accordion 打开。
$(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();
});
});
/*----- Accordion -----*/
.accordion,
.accordion * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.accordion {
overflow: hidden;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25);
border-radius: 3px;
background: #3bb54a;
}
/*----- Section Titles -----*/
.accordion-section-title {
width: 100%;
padding: 15px;
display: inline-block;
border-bottom: 1px solid #1a1a1a;
background: #FFF;
transition: all linear 0.15s;
/* Type */
font-size: 1.200em;
text-shadow: 0px 1px 0px #1a1a1a;
color: #fff;
}
.accordion-section-title.active,
.accordion-section-title:hover {
background: #FBCB34;
/* Type */
text-decoration: none;
}
.accordion-section:last-child .accordion-section-title {
border-bottom: none;
}
/*----- Section Content -----*/
.accordion-section-content {
padding: 15px;
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion-1"><h3 class="portseparator">Museums & History</h3></a>
<div id="accordion-1" class="accordion-section-content">
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-lighthouse.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-lighthouse.JPG" style="width:100%;height:auto;" alt="St. Augustine Lighthouse & Maritime Museum">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.staugustinelighthouse.com/">St. Augustine Lighthouse & Maritime Museum</a></h3>
<p>America’s history will never look the same after a visit to the St. Augustine Lighthouse & Maritime Museum. From the breathtaking views of Northeast Florida to the artifacts recovered from our ancestors’ vessels, the St. Augustine Lighthouse
& Maritime Museum covers centuries of history from in and around St. Augustine.
</p>
<h5><a target="_blank" href="http://www.staugustinelighthouse.com/">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-fortmatazanas.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-fortmatazanas.JPG" style="width:100%;height:auto;" alt="Fort Matanzas National Monument">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.nps.gov/foma/">Fort Matanzas National Monument</a></h3>
<p>Coastal Florida was a major field of conflict as European nations fought for control in the New World. As part of this struggle, Fort Matanzas guarded St. Augustine’s southern river approach. The colonial wars are over, but the monument is still
protecting—not just the historic fort, but also the wild barrier island and the plants and animals who survive there amidst a sea of modern development.</p>
<h5><a target="_blank" href="http://www.nps.gov/foma/">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-casillodesanmarcos.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-casillodesanmarcos.JPG" style="width:100%;height:auto;" alt="Castillo de San Marcos">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.nps.gov/casa/index.htm">Castillo de San Marcos</a></h3>
<p>A monument not only of stone and mortar but of human determination and endurance, the Castillo de San Marcos symbolizes the clash between cultures which ultimately resulted in our uniquely unified nation. Still resonant with the struggles of
an earlier time, these original walls provide tangible evidence of America’s grim but remarkable history.</p>
<h5><a target="_blank" href="http://www.nps.gov/casa/index.htm">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-pirate&treasure.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-pirate&treasure.JPG" style="width:100%;height:auto;" alt="St. Augustine Pirate & Treasure Museum">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://thepiratemuseum.com">St. Augustine Pirate & Treasure Museum</a></h3>
<p>In addition to the world class museum, the property boasts a scenic outdoor courtyard and a large deck that overlooks the historic Matanzas River and the magnificent Castillo de San Marcos, the 17th Spanish fort located directly across the street
on the bayfront. The museum spans about 5,000 square ft. with a 1,300-square.-ft. courtyard and an approximate 500-square-ft. upper deck. There are several event packages to choose from that also include museum access.</p>
<h5><a target="_blank" href="http://www.thepiratemuseum.com">Click here for more information!</a></h5>
</div>
</div>
</div>
<!--end .accordion-section-content-->
</div>
<!--end .accordion-section-->
</div>
<!--end .accordion-->
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion-1">
<h3 class="portseparator">State Parks & Recreation</h3>
</a>
<div id="accordion-1" class="accordion-section-content">
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-wildlifereserve.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-wildlifereserve.JPG" style="width:100%;height:auto;" alt="St. Augustine Wild Reserve">
</a>
</div>
<div class="col-md-6">
<h3><a href="http://www.staugustinewildreserve.org">St. Augustine Wild Reserve</a></h3>
<p>Guests will be given a guided tour of the 7-acre animal compound by an experienced wildlife professional. An introduction to each species, basic biology, and how the animal arrived at the sanctuary will be discussed in detail. Visitors will
be allowed within 5-10 feet of the exotic animals, which are housed in secure habitats. On the tour there will be tigers, an American black bear, cougars, lynxes, leopards, wolves, and a host of other animals.
</p>
<h5><a href="http://www.staugustinewildreserve.org"> Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-anastasiastatepark.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-anastasiastatepark.JPG" style="width:100%;height:auto;" alt="Anastasia State Park">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="https://www.floridastateparks.org/park/anastasia">Anastasia State Park</a></h3>
<p>Anastasia State Park includes 1,600 acres of rich ecosystems and abundant wildlife. Explore up to four miles of pristine beach, the estuarine tidal marsh teeming with plant and animal life, or the self-guided nature trail which takes you through
the maritime hammock and onto ancient sand dunes. You can also visit the Coquina Quarry, an archaeological site where coquina rock was mined to help construct the nearby Castillo de San Marcos National Monument, earning it a spot on the National
Register of Historic Places.</p>
<h5><a target="_blank" href="https://www.floridastateparks.org/park/anastasia">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-alligatorfarm.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-alligatorfarm.JPG" style="width:100%;height:auto;" alt="Coming Soon">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.alligatorfarm.com/">St. Augustine Alligator Farm Zoological Park</a></h3>
<p>The St. Augustine Alligator Farm Zoological Park is one of Florida’s oldest continuously running attractions, having opened on May 20, 1893. Not only does it have 23 species of crocodilians, but also a variety of other reptiles, mammals,
and birds, as well as exhibits, animal performances and educational demonstrations.
</p>
<h5><a target="_blank" href="http://www.alligatorfarm.com">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-beach.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-beach.JPG" style="width:100%;height:auto;" alt="St. Augustine Beach">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.staugustinelighthouse.com/">St. Augustine Beach</a></h3>
<p>St. Augustine’s beaches stretch from Vilano Beach north of the city to Crescent Beach in the south. The Intracoastal Waterway naturally divides the mainland from the barrier islands with their miles of gorgeous coastline with many public
areas for beach recreation and relaxation.</p>
<h5><a target="_blank" href="http://www.oldcity.com/beaches">Click here for more information!</a></h5>
</div>
</div>
</div>
<!--end .accordion-section-content-->
</div>
<!--end .accordion-section-->
</div>
<!--end .accordion-->
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion-1"><h3 class="portseparator">Local Golf Courses</h3></a>
<div id="accordion-1" class="accordion-section-content">
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-stjohns.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-stjohns.JPG" style="width:100%;height:auto;" alt="St. Johns Golf & Country Club">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.stjohnsgolf.com">St. Johns Golf & Country Club</a></h3>
<p>St. Johns Golf & Country Club is an extraordinary place located between St. Augustine and Jacksonville. The 18-hole Clyde Johnston-designed course is the community’s centerpiece with just the right amount of challenge for novice and
avid golfers alike. A great place to hone your skills, St. Johns is known for its consistent quality of service and conditions.</p>
<h5><a target="_blank" href="http:/www.stjohnsgolf.com">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-southampton.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-southampton.JPG" style="width:100%;height:auto;" alt="South Hampton Golf Club">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.golfsouthhampton.com/">South Hampton Golf Club</a></h3>
<p>The course has 16 lakes and over 60 bunkers, but the layout is fair. The back nine is a bit more adventurous so do your scoring on the front nine. There is a great variety of holes and you will not be bored playing here. The course is now family
owned and all the staff are very friendly and helpful. You can’t go wrong playing here as the rates are very reasonable and the course challenging and interesting.</p>
<h5><a target="_blank" href="http:/www.golfsouthhampton.com/">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-royalgolf.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-royalgolf.JPG" style="width:100%;height:auto;" alt="Royal St. Augustine Golf & Country Club">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.royalstaugustinegolf.com/">Royal St. Augustine Golf Club</a></h3>
<p>If you are looking for a course close to downtown, Royal St Augustine is it. The conditions are generally good here and the staff is friendly. This is a very tight golf course and if you are even slightly off the fairways, kiss that golf ball
goodbye. Two fairways line the road, if your tee shot missed the narrow fairway, your next shot is from the passing lane of Route 16. However if you want to tee it up near town on a well maintained course, this is a good choice. Just bring
plenty of balls, and a straight tee shot.</p>
<h5><a target="_blank" href="http://www.royalstaugustinegolf.com/">Click here for more information!</a></h5>
</div>
</div>
</div>
<!--end .accordion-section-content-->
</div>
<!--end .accordion-section-->
</div>
<!--end .accordion-->
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion-1"><h4 class="portseparator">Food & Entertainment</h4></a>
<div id="accordion-1" class="accordion-section-content">
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-staugustinedistillery.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-staugustinedistillery.JPG" style="width:100%;height:auto;" alt="St. Augustine Distillery Company">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.staugustinedistillery.com">St. Augustine Distillery Company</a></h3>
<p>Take a free tour of the distillery and watch as they mix, mash, cook and distill small batch vodka, rum, gin and whiskey in a historically renovated ice manufacturing plant from 1917. You will learn about the history of ice and distilling in
Florida, see the products being made, and then taste their small batch spirits for yourself in the tasting room. There’s no charge and tours are every 30 minutes. Come on by!</p>
<h5><a target="_blank" href="http://www.staugustinedistillery.com"> Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-sansabastienwine.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-sansabastienwine.JPG" style="width:100%;height:auto;" alt="San Sebastian Winery">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.sansebastianwinery.com/">San Sebastian Winery</a></h3>
<p>Today, San Sebastian ranks as one of Florida’s premium wineries, and remains a pioneer in the development of table, sparkling, and dessert wines from hybrid and muscadine grapes. Vintage-dated varietals from hybrids such as Stover and Blanc
Du Bois are produced and marketed along with blended and sparkling wines from native Muscadine grapes. Port and Cream Sherry dessert wines are also produced by and sold under the San Sebastian brand.</p>
<h5><a target="_blank" href="http://www.sansebastianwinery.com/"> Click here for more information!</a></h5>
</div>
</div>
</div>
<!--end .accordion-section-content-->
</div>
<!--end .accordion-section-->
</div>
<!--end .accordion-->
<a class="anchorlink" id="events" a name="events"></a>
<h3 class="title">Area Events</h3>
<p style="color:#0071bc;font-size:1.65em;">St. Augustine is a venue for all types of events large and small, historical and modern, educational and entertaining. Featured events in St. Augustine include annual headliners at the Amphitheatre, exciting new art exhibits, local festivals, seasonal
celebrations for holidays, and many other major occasions in the city, including the 450th commemoration. St. Augustine welcomes thousands of visitors every year for the many events it hosts. These include one of the most celebrated, the Nights of Lights,
to more local events like the Music by the Sea concerts.</p>
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion-1"><h4 class="portseparator">Area Events</h4></a>
<div id="accordion-1" class="accordion-section-content">
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-farmersmarket.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-farmersmarket.JPG" style="width:100%;height:auto;" alt="Third Saturdays Nocatee Farmers Market">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.nocatee.com/">Third Saturdays Nocatee Farmers’ Market</a></h3>
<h4>February 20, 2016 to December 17, 2016</h4>
<p>Nocatee Farmer’s Market takes place from 10:00AM - 2:00PM every third Saturday. This free family-friendly event has over 80 local vendors selling everything from produce, crafts, jewelry, herbs, unique foods and more. Free face painting
will be available for the little ones, along with a bounce house.</p>
<h5><a target="_blank" href="http://www.nocatee.com/">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-cathedralfestival.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-cathedralfestival.JPG" style="width:100%;height:auto;" alt="Cathedral Festival">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://augustine.com/event/cathedral-festival">Cathedral Festival</a></h3>
<h4>Friday – Sunday, February 26 - 28, 2016</h4>
<p>The 31st Annual Cathedral Festival at the Mission of Nombre de Dios grounds offers fun for the whole family. Located near the giant cross in St. Augustine, visitors are welcome to enjoy the fun rides, games, raffles, bingo, food and art vendors,
fireworks and more. Families will enjoy exciting midway rides that are thrilling for all ages including a Ferris wheel, slides and much more.</p>
<h5><a target="_blank" href="http://augustine.com/event/cathedral-festival">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-lionsseafoodfestival.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-lionsseafoodfestival.JPG" style="width:100%;height:auto;" alt="St. Augustine's Lion Seafood Festival">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://augustine.com/event/st-augustine-lions-seafood-festival">St. Augustine’s Lion Seafood Festival</a></h3>
<h4>March 4 - 6, 2016</h4>
<p>The 35th Annual St. Augustine Lions Seafood Festival features delicious seafood, arts and crafts, live music, family activities, and much more. The festival takes place at Francis Field, Friday – Sunday, March 4 – 6, 2016.</p>
<h5><a target="_blank" href="http://augustine.com/event/st-augustine-lions-seafood-festival">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-stpattys.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-stpattys.JPG" style="width:100%;height:auto;" alt="St. Patrick’s Day Parade">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.celticstaugustine.com/st-patricks-day-parade/">St. Patrick’s Day Parade</a></h3>
<h4>March 12, 2016</h4>
<p>St. Augustine’s St. Patrick Day Parade is the ONLY St. Patrick’s Day Parade in Northeast Florida. The Parade is an annual celebration of St. Augustine’s Celtic heritage and the Emerald Isle’s most revered saint. With over 800 participants and
thousands of spectators, lads and lasses converge upon the Ancient City each year doning their tartans and green attire.</p>
<h5><a target="_blank" href="http://www.celticstaugustine.com/st-patricks-day-parade/">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-bbqfestival.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-bbqfestival.JPG" style="width:100%;height:auto;" alt="Rhythm & Ribs Festival">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://augustine.com/event/rhythm-ribs-festival">Rhythm & Ribs Festival</a></h3>
<h4>Friday - Sunday, April 1 - 3, 2016</h4>
<p>The 21st Annual Rhythm & Ribs Festival celebrates delicious barbecue, music and good times with live entertainment and local chefs competing for the best BBQ. This festival includes great live music throughout the weekend, people’s BBQ choice
awards, a kids zone, mechanical bull, an array of vendors, and much more.</p>
<h5><a target="_blank" href="http://augustine.com/event/rhythm-ribs-festival">Click here for more information!</a></h5>
</div>
</div>
<div class="col-md-12 portfolio">
<div class="col-md-6" style="text-align:center;">
<a href="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-romanza.JPG" data-featherlight="image">
<img src="assets/css/images/AlexImages/compass-rv-park-st.%20augustine-romanza.JPG" style="width:100%;height:auto;" alt="Coming Soon">
</a>
</div>
<div class="col-md-6">
<h3><a target="_blank" href="http://www.see-staugustine.com/events/romanza-festivale-in-st-augustine-2016-05-08/#.VraiH9A_u9U">Romanza Festivale in St. Augustine</a></h3>
<h4>May 6 - 15, 2016</h4>
<p>Come to Saint Augustine from May 6 through the 15, 2016 for a celebration of art and music in the Nation’s oldest city featuring more than 60 events and exhibits by dozens of organizations. Daily events include music and dance performances,
concerts, art shows, dramatic productions and much more at locations throughout the city.</p>
<h5><a target="_blank" href="http://www.see-staugustine.com/events/romanza-festivale-in-st-augustine-2016-05-08/#.VraiH9A_u9U">Click here for more information!</a></h5>
</div>
</div>
</div>
<!--end .accordion-section-content-->
</div>
<!--end .accordion-section-->
</div>
<!--end .accordion-->
最佳答案
这是因为所有 Accordion 共享相同的 ID 属性 accordion-1
。如果将它们更改为在 ID 末尾具有不同的数字,则每个开口都应该正常工作。
要解决关闭问题,您还需要将要关闭的 Accordion 的元素或 ID 传递到 close_accordion_section
函数中。否则它的目标是所有 Accordion 。例如
$(document).ready(function() {
function close_accordion_section(element) {
$(element).find('.accordion-section-title').removeClass('active');
$(element).find('.accordion-section-content').slideUp(300).removeClass('open');
}
$('.accordion-section-title').click(function(e) {
// Grab current anchor value
var currentAttrValue = $(this).attr('href');
if ($(this).is('.active')) {
close_accordion_section($(e.target).closest('.accordion'));
} else {
// Add active class to section title
$(this).addClass('active');
// Open up the hidden content panel
$('.accordion ' + currentAttrValue).slideDown(300).addClass('open');
}
e.preventDefault();
});
});
关于javascript - Accordion 打开页面上的所有 Accordion ,再次单击时不会折叠。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35328205/
我开始学习 Oracle JavaSE 认证考试。 我创建了一个 IntelliJ Idea 项目来处理我的训练源代码。我想尽量减少 IntelliJ Idea 的帮助。 我只想使用:颜色语法、终端选
默认情况下,.DPR 和 .DPROJ 的文件扩展名描述是相同的,因此在资源管理器中打开具有相同基本名称的项目文件时,两个文件描述都会列为“Delphi 项目文件”,这提供了一个选择开发人员 - 要打
我目前正在从 android 网站了解 Navigation Drawer,我正在使用他们的示例 http://developer.android.com/training/implementing-
我需要帮助。 我在 A3:A500 列中有单词和数字 我需要改变他们的名字。 如果单元格包含单词“previ”,则如果单元格是数字,则将字母“p”放入新列中。如果它是一个词,那么不要放“p” ...就
我正在尝试编写一些 VBA,它允许按钮添加一个空行,保持相同的格式,就在 SUM 公式所在的行上方。 到目前为止,我实现了创建一个空行,但我不知道如何实现代码以让该新行继承相同的格式样式(包括边框和格
我在共享网络驱动器上有两个工作簿: 工作簿 A(表) 工作簿 B(数据透视表 - 连接到源工作簿 A) 我正在尝试,当打开 Workbook B 时,运行宏并执行以下操作: 取消保护工作簿 B 上的某
我正在开发一个需要在在线/离线模式下进行测试的应用程序,所以我想知道是否有任何方法可以打开/关闭 iPad 模拟器的互联网连接(不关闭我的 MAC 的互联网服务)。请帮忙 最佳答案 不,模拟器使用与您
我需要对目录的所有文件执行我的脚本(搜索)。以下是有效的方法。我只是问哪个最好。 (我需要格式的文件名:parsedchpt31_4.txt) 全局: my $parse_corpus; #(for
在我的代码中,我想有条件地执行一些操作: #ifdef DEBUG NSLog(@"I'm in debug mode"); #endif 我已配置“项目”->“编辑项目设置”->“构建”选项卡,以便
我编写了一个小程序来比较笔记本电脑的性能。为了使程序CPU更加密集,我用一些多线程代码(通过Parallel API实现)实现了Rabin-Karp模式匹配算法。 我注意到,当在关闭编译器优化标志的情
使用以下代码来关闭模态并打开第二个模态。总是遇到同样的问题可以关闭一个但不能打开第二个,或者如果我更改顺序我可以打开一个但不能关闭另一个。 (我想我已经尝试过101版本了)。如果有人能帮忙的话。
blue sky 默认情况下,当指针悬停时显示标题。 是否可以切换它,例如: $('#button').on('click', function(){ if (something) {turn
我正在编写一个简单的宏,它将打开、保存和关闭一个 Excel 文件(例如 myworkbook.xlsx),但我无法执行此操作。我的文件 myworkbook.xlsx 位于以下位置: C:\User
我正在加载两个 geoJson 层 - 出于测试目的,两个层都是相同的数据,但是是从两个不同的 json 文件中提取的。当我在图层 Controller 中打开和关闭图层时,图层的绘制顺序会发生变化。
我在我的设置 Activity 中发现,当用户单击 ToggleButton 时,它应该在整个应用程序中静音,但它不起作用。我在教程类中放入的 SoundPool onClick 按钮声音仍在 onC
我有一部双卡手机。如果我想打开飞行模式,两个 SIM 卡都会发生这种情况。 是否可以通过编程方式仅对一张SIM卡进行操作(用户可以选择两者之一)?我看到了here上的帖子,他们一直工作到 API 16
我目前正在开发一个带有一些 pipe() 和重定向的 C shell 程序。 我使用 dup2() stdout 和 stderr (1 & 2) 重定向。 当我用 int fd = open("te
Jquery: 有没有办法捕获浏览器打开“打开/另存为”对话框时触发的事件? Open/Save dialog example http://qpack.orcanos.com/helpcenter/
我知道你可以用 window.close 关闭 window.open 但还有其他方法吗?我有一个打开 facebook 连接的弹出窗口,我想在用户连接到 facebook 时关闭弹出窗口,然后刷新父
我搜索一个事件,如果不存在,则搜索一种方法来了解屏幕是否关闭(电源选项 - 控制面板 - 关闭显示设置)。 这些解决方案都不适合我。 所以要么我在某个地方错了,要么就是不合适。 How to get
我是一名优秀的程序员,十分优秀!