Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- একরডিয়ন এর ব্যবহারঃ
- -----------------
- ধাপ-১ঃ একরডিয়ন দুই ভাবে ব্যবহার করা যায়ঃ প্লাগিন ও সিএসএস স্টাইল করে । আমি আমার পছন্দ মত ব্যবহার করবো ।
- ------
- ধাপ-২ঃ index.html , style.css ও jQuery তে কমান্ড করা ।
- ------
- ধাপ-৩ঃ প্লাগিন ব্যবহার করলে লিঙ্ক গুলো বডিতে ব্যবহার করতে হতঃ <link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all" />
- ------ <script type="text/javascript" src="js/jquery-ui.js"></script>
- ----------------------------------------------------------------------------------------------------------------------------------------
- উদাহরণঃ
- index.html
- =========
- <div class="accrodion_container fix">
- <div class="accordion_head active fix">
- <h2>Accordion Heading 1</h2>
- <div class="accrod_icons">
- <span class="icon_minus"></span>
- <span class="icon_plus"></span>
- </div>
- </div>
- <div class="accordion_body fix">
- <p>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 class="accordion_head fix">
- <h2>Accordion Heading 2</h2>
- <div class="accrod_icons">
- <span class="icon_minus"></span>
- <span class="icon_plus"></span>
- </div>
- </div>
- <div class="accordion_body fix">
- <p>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 class="accordion_head fix">
- <h2>Accordion Heading 3</h2>
- <div class="accrod_icons">
- <span class="icon_minus"></span>
- <span class="icon_plus"></span>
- </div>
- </div>
- <div class="accordion_body fix">
- <p>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 class="accordion_head fix">
- <h2>Accordion Heading 4</h2>
- <div class="accrod_icons">
- <span class="icon_minus"></span>
- <span class="icon_plus"></span>
- </div>
- </div>
- <div class="accordion_body fix">
- <p>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>
- -------------------------------------------------------------------------------------------------------------------------------
- style.css
- ---------
- /* Accordion Style */
- .accrodion_container{}
- .accordion_head{
- padding: 10px;
- background: #ddd;
- border: 1px solid #ccc;
- cursor: pointer;
- margin-top: 15px;
- position: relative;
- }
- .accordion_head:first-child{margin-top: 0px;}
- .accordion_head h2{
- margin: 0px;
- font-size: 25px;
- line-height: 30px;
- font-weight: 100;
- text-transform: uppercase;
- }
- .accrod_icons{
- position: absolute;
- top: 25px;
- right: 20px;
- }
- span.icon_minus{
- width: 24px;
- height: 2px;
- background: #000;
- display: block;
- }
- span.icon_plus{
- display: block;
- position: absolute;
- height: 22px;
- width: 2px;
- background: #000;
- left: 11px;
- top: -10px;
- opacity: 1;
- -webkit-transition: all .5s;
- transition: all .5s;
- }
- .accordion_head.active span.icon_plus{
- opacity: 0;
- }
- .accordion_body{
- padding: 20px;
- border: 1px solid #333;
- background: #000;
- color: #fff;
- display: none;
- }
- .accordion_body p{
- margin: 0px;
- margin-bottom: 15px;
- }
- .accordion_body p:last-child{margin-bottom: 0px;}
- ----------------------------------------------------------------------------------------------------------------
- jQuery কমান্ডঃ
- -------------
- // Custom js Accordion
- $(document).ready(function() {
- // All Accordion Body hidden
- $('div.accordion_body').hide();
- // Only Accordion Body First Child Show
- $('div.accordion_body:first').show();
- // Accordion Click Function
- $('div.accordion_head').on('click', function() {
- if($(this).next().is(':hidden')){ // Jodi Accordion body hide thake
- $('div.accordion_body').slideUp().prev().removeClass('active');// all Accordion body slideup
- $(this).addClass('active').next().slideDown();// this heading accordion body slidedown
- } else{
- $(this).removeClass('active').next().slideUp();// else accordion body slideup
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment