Simple Accordian
How do I make an simple accordian?
What is a simple accordian? How do you make a simple accordian? This script and codes were developed by Sean Stopnik on 21 December 2022, Wednesday.
Simple Accordian - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Accordian</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <dl class="accordian"> <dt>Item One</dt> <dd> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </dd> <dt>Item Two</dt> <dd> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </dd> <dt>Item Three</dt> <dd> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </dd> <dt>Item Four</dt> <dd> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </dd> <dt>Item Five</dt> <dd> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </dd>
</dl> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Simple Accordian - Script Codes CSS Codes
body { color: #333; line-height: 1.5; background: #333; padding: 20px;
}
.accordian { border-radius: 3px; padding: 0; overflow: hidden;
}
.accordian dt,
.accordian dd { background: #fff; margin: 0;
}
.accordian dt { position: relative; font-weight: bold; border-top: 1px solid #e9e9e9; padding: 10px 15px; cursor: pointer;
}
.accordian dt:first-child { border: 0;
}
.accordian dt:before, .accordian dt:after { position: absolute; top: 50%; background: #353535; content: ''; -webkit-transition: all .4s ease-in; transition: all .4s ease-in;
}
.accordian dt:before { right: 15px; width: 10px; height: 2px; margin: -1px 0 0;
}
.accordian dt:after { right: 19px; width: 2px; height: 10px; margin: -5px 0 0;
}
.accordian dt.is-active:before, .accordian dt.is-active:after { -webkit-transform: rotate(360deg); transform: rotate(360deg); background: #ff0027;
}
.accordian dt.is-active:after { -webkit-transform: rotate(-90deg); transform: rotate(-90deg);
}
.accordian dd { display: none; padding: 5px 15px 20px;
}
.accordian p { padding: 0 0 20px; margin: 0;
}
.accordian p:last-child { padding: 0;
}
Simple Accordian - Script Codes JS Codes
var accordianTitle = $('.accordian dt'), accordianContent = $('.accordian dd');
accordianTitle.first().addClass('is-active');
accordianContent.first().show();
accordianTitle.on('click', function(){ accordianTitle.removeClass('is-active'); accordianContent.slideUp(); $(this).addClass('is-active') .next(accordianContent) .slideDown();
});
Developer | Sean Stopnik |
Username | seanstopnik |
Uploaded | December 21, 2022 |
Rating | 3 |
Size | 2,995 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Custom Checkboxes | 3,500 Kb |
CSS Range Slider | 3,218 Kb |
Photo Card | 4,287 Kb |
A Pen by Sean Stopnik | 2,673 Kb |
Simple Slider Effect in CSS - Vertical | 3,183 Kb |
CSS Donut Charts - Animated | 3,502 Kb |
CSS Donut Charts | 2,908 Kb |
Save to Favorites | 3,419 Kb |
Save to Favorites | 3,395 Kb |
Simple Slider Effect in CSS - Horizontal | 3,235 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Polo, the flying squirrel | Agbales | 2,445 Kb |
Simple, flat contact form | Zeaklous | 2,719 Kb |
Myprofile | SoufianeAbid | 2,451 Kb |
Eunice A | Ejbronze | 2,203 Kb |
Flexbox Test | Icutpeople | 2,486 Kb |
Minimelephant | Smashlee | 2,507 Kb |
React Markdown Previewer | C0d0er | 3,190 Kb |
Layout 11 | Altynai | 1,690 Kb |
Intake Form Page 2 | Ijantje | 4,983 Kb |
Multi column experiment. | Spylefkaditis | 2,805 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!