"Professional accordion"
Bootstrap 3.2.0 Snippet by Sagar Joshi

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css' />
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<div id="integration-list">
<ul>
<li>
<a class="expand">
<div class="right-arrow">+</div>
<div>
<h2>C.I.Agent Solutions</h2>
<span>Meets SPCC Regulation 40CFR112, Oil spill solutions, Oil Solidifier - just pick it up and send it to a land fill, Spill kits, Sub-station containment</span>
</div>
</a>
<div class="detail">
<div id="left" style="width:15%;float:left;height:100%;">
<div id="sup">
<img src="http://www.ciagent.com/ciagent/cialogo4.png" width="100%" />
</div>
</div>
<div id="right" style="width:85%;float:right;height:100%;padding-left:20px;">
<div id="sup">
<div><span>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</span>
<br />
<br /><a href="#">Visit Website</a>
</div>
</div>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#integration-list {
font-family: 'Open Sans', sans-serif;
width: 80%;
margin: 0 auto;
display: table;
}
#integration-list ul {
padding: 0;
margin: 20px 0;
color: #555;
}
#integration-list ul > li {
list-style: none;
border-top: 1px solid #ddd;
display: block;
padding: 15px;
overflow: hidden;
}
#integration-list ul:last-child {
border-bottom: 1px solid #ddd;
}
#integration-list ul > li:hover {
background: #efefef;
}
.expand {
display: block;
text-decoration: none;
color: #555;
cursor: pointer;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
$(function() {
$(".expand").on( "click", function() {
$(this).next().slideToggle(200);
$expand = $(this).find(">:first-child");
if($expand.text() == "+") {
$expand.text("-");
} else {
$expand.text("+");
}
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

problem: doesn't open accordeon when I press the PLUS sign

js fails to work in my case

johnny () - 7 years ago - Reply 1


I have a problem with "Professional accordion" I built but when I click on it and goes back down immediately and does not allow me to view the contents of the "detail".
I work with Typo3 and bootstrap version 7.6.5.
Can anyone help me?
thank you in advance

Sylvie Rouche () - 8 years ago - Reply 1


Good design. but it has some problems for other ul inside detail class.. to solve change all the css to..
#integration-list ul -----------> ul.integration-list
and for HTML add the class to the UL...
<div id="integration-list"><ul> -------------> <div><ul class="integration-list">
with this only affects the li elements for the accordion, and not the content..

Henry Gabriel () - 9 years ago - Reply 0