- 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/
我在选项卡中有我的网络应用程序的选项。 aaa bbb ccc ddd eee 当用户单击任何选项卡(在同一窗口中)时,我会使用此代码获得淡出效果,然后自动
如何获得一个简单的调用单击来实现如下功能:http://jsfiddle.net/ftwPS/6/我显然错过了一些基本的东西,因为当您单击“CLICK”时这不起作用。 $('tr').click(fu
我有一个列表,在左侧显示一个插入符号图标,单击它时应该更改图标。每当我单击一个图标时,所有图标都会更改。 detailedInfo = []; subordinateInfo; openSu
我有一个 div,我想对其进行设置,以便当我单击其他内容时,它会隐藏该 div。 我也是这样 $('body').click(function(){ if(loginOpened) {
我有很多装有不同内容的盒子。 如果单击第一个框,您可以看到一个包含更多详细信息的弹出框。如果单击第二个、第三个等框,您必须查看这些框的详细信息。 我的问题:如果我点击框号。 2 我看到了盒子号的详细信
当我点击 .add-btn 时,我将 .add-btn 的样式更改为 background:#cccccc 并将 val() 更改为“-”。 现在当我用 tr td .list 删除添加的文本时,它是
感谢 SO 的出色贡献者!当您开始了解 jQuery 时,它会变得更酷。 :) 所以我有一个 LI,单击时会显示/隐藏子 UL。我想做的是能够单击 LI 内的链接,打开一个空白窗口,但也不会关闭子 U
我有这份文档,它使我能够获得一份带有点击进度的多项选择选择调查问卷。 如何用图像代替此处的文字? (并且仍然有这样的机制,一旦单击[图像],就会提出下一个问题) 我已经尝试使用 UL/H1 设置背景图
我想在 JQGrid 的刷新按钮单击上编写代码。有什么事件吗? 最佳答案 如果您需要在开始刷新之前执行一些操作,您应该使用 beforeRefresh打回来: $("#grid_id").jqGrid
问题是将对象或多个参数从模板传递到组件,并使用它们将数据添加到 API。 任务.service.ts addTasks(task: Task): Observable{ let headers =
我有一个像这样的primefaces选项卡 View : This tab has static content. this t
我在 jquery 中有一个有效的 a.click() 函数...但是如果我单击一个 anchor ,我会打开一个新窗口...但是我怎样才能阻止浏览器本身打开一个新窗口? 示例: $('a')
有没有简单的方法来创建代码:如果 URL 更改或单击链接显示 div(例如加载 gif 3 秒),则显示页面?有点像空白的白色页面,加载 gif 旋转 3 秒然后显示页面? 谢谢! 最佳答案 给定 G
我需要知道此时按钮的状态是否被点击? 谢谢 最佳答案 if (myButton.state & UIControlStateHighlighted) { // Do your stuff the
我正在 NSImageView 上绘制一条 NSBezierPath 线。我正在创建 NSBezierPath 对象,设置 moveToPoint,设置 lineToPoint,设置 setLineW
我的 Selenium 代码存在问题,无法正确执行按键 + 单击操作。 测试应打开 jqueryui.com 链接并选择页面上的前 2 个 li 元素。 我正在使用 Selenium 2.23 和 F
单击时我将更改字符串一部分的样式。例如“TEXT”,然后单击“T”,之后它会将样式从黑色更改为红色,仅 T在我的代码中,当我单击文本时,我拆分文本并保留在“split”数组中,它将调用handleCl
我在网站上有一个 anchor 。当有人点击它时,我在 jquery 中执行一些操作并更改名称,但是当再次单击它时,事件被触发,尽管我已经更改了它的名称。代码在这里: $(".like_cont a[
我有一个下载链接Download我希望每次当有人点击“下载”时,我都可以将其插入数据库total_downloads+1。为了插入数据库,我通常使用 然后 if (isset($_POST['d
我是一名优秀的程序员,十分优秀!