Created
March 16, 2018 01:15
-
-
Save anonymous/94e286765f90f5c64f50fff6c7e88d4e to your computer and use it in GitHub Desktop.
(source: http://jsfiddle.net/UpuDU/6/4/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clear{ | |
clear:both; | |
display:block; | |
height:0; | |
width:auto; | |
} | |
.faq-row-container{ | |
font-family:Arial, Helvetica, sans-serif; | |
} | |
.faq-row { | |
background-color: #fff; | |
border: #ccc 1px solid; | |
margin-bottom: 12px; | |
position:relative; | |
overflow:hidden; | |
} | |
.faq-row-handle { | |
border:#ccc 1px solid; | |
border-bottom:none; | |
} | |
.faq-row-handle > a { | |
cursor: pointer; | |
display: block; | |
color: #191919; | |
font-weight: normal; | |
font-size: 13px; | |
padding: 7px 30px 7px 10px; | |
line-height: 20px; | |
text-decoration: none; | |
outline: 0; | |
float:left; | |
border-right: #ccc 1px solid; | |
} | |
.faq-row-handle a.open{ | |
color:green; | |
} | |
.faq-row-content { | |
color: #666; | |
font-weight: normal; | |
line-height: 150%; | |
font-size: 13px; | |
display: none; | |
position:absolute; | |
top:0; | |
left:0; | |
} | |
.faq-row-content.open{ | |
display:block; | |
} | |
.faq-row-content p { | |
padding: 0 14px 10px 14px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="faq-row-container"> | |
<div class="faq-row-handle"> | |
<a href="javascript:;" rel="item1">1. item</a> | |
<a href="javascript:;" rel="item2">2. item</a> | |
<a href="javascript:;" rel="item3">3. item</a> | |
<a href="javascript:;" rel="item4">4. item</a> | |
<a href="javascript:;" rel="item5">5. item</a> | |
<a href="javascript:;" rel="item6">6. item</a> | |
<div class="clear"></div> | |
</div> | |
<div class="faq-row"> | |
<div id="item1" class="faq-row-content"> | |
<p>1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> | |
</div> | |
<div id="item2" class="faq-row-content"> | |
<p>2 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> | |
</div> | |
<div id="item3" class="faq-row-content"> | |
<p>3 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic ions of Lorem Ipsum.</p> | |
</div> | |
<div id="item4" class="faq-row-content"> | |
<p>4 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen</p> | |
</div> | |
<div id="item5" class="faq-row-content"> | |
<p>5 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages.</p> | |
</div> | |
<div id="item6" class="faq-row-content"> | |
<p>6 Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> | |
</div> | |
<div class="clear"></div> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var tab = $('.faq-row-handle > a'), | |
tabContent = $('.faq-row-content'), | |
tabParent = $('.faq-row'); | |
if(tab.length){ | |
tab.off('click').on('click', function(){ | |
var ele = $(this), | |
currContent = $('#'+ele.attr('rel')); | |
if(!ele.hasClass('open')){ | |
tabParent.stop(true, true).animate({ | |
height:'0px' | |
},function() { | |
tabContent.removeClass('open'); | |
currContent.addClass('open'); | |
tab.removeClass('open'); | |
ele.addClass('open'); | |
tabParent.stop(true, true).animate({ | |
height:currContent.height()+'px' | |
}); | |
}); | |
} | |
}); | |
$('.faq-row-handle > a:eq(0)').click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment