Giter Site home page Giter Site logo

imelgrat / tab-collapse Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 9 KB

While Bootstrap's Collapse component (accordions) can be very useful and works well in mobile websites, tab-based navigation usually works better in desktop screens. This component provides a way to integrate both tabs and accordions using some extra CSS and Javascript.

License: MIT License

HTML 100.00%
accordion collapse navigation bootstrap bootstrap-collapse-component css javascript jquery bootstrap-components css3 js bootstrap-collapse collapse-component tab-navigation tabs

tab-collapse's Introduction

Tab/Collapse

While Bootstrap's Collapse component (accordions) can be very useful and works well in mobile websites, tab-based navigation usually works better in desktop screens. This component provides a way to integrate both tabs and accordions using some extra CSS and Javascript.

Developed by Ivan Melgrati Twitter

License: GitHub license

Status: GitHub release GitHub issues GitHub forks GitHub stars

Requirements

  • jQuery >= 3.0
  • Bootstrap >= 3.3

Installation

While most of the code required to make tabs and accordions work comes from Bootstrap, it is necessary to add some extra code to make the "component switch" between tabs and accordions view and navigation work. After adding both jQuery and Bootstrap, it's necessary to add the component's CSS rules and JavaScript code

<link rel="stylesheet" href="../dist/css/tabcollapse-style.css" crossorigin="anonymous">
<script src="../dist/js/tabcollapse-script.js" crossorigin="anonymous"></script>

Usage

For the Tab/Collapse to work, it's necessary to create three blocks. The vertab-container div (the whole component's container, used as CSS and JS selector), the vertab-menu section (tab navigation links) and the vertab-accordion section (accordion and content sections). For each content section, it's necessary to create a link inside the list-group block and a vertab-content block.

<div class="col-lg-12 vertab-container">
	<div class="col-lg-3 col-md-3 col-sm-3 vertab-menu">
		<div class="list-group">
			<a href="#" class="list-group-item text-left"> This is Tab 1 </a>
			.......
		</div>
	</div>
	<div id="accordion" class="col-lg-9 col-md-9 col-sm-9 col-xs-12 vertab-accordion panel-group">
		<div class="vertab-content">
			<div class="panel-heading">
				<h4 class="panel-title" data-toggle="collapse" data-parent="#accordion" data-target="#collapse1"> This is Heading 1 </h4>
			</div>
			<div id="collapse1" class="panel-collapse collapse">
				<div class="panel-body">
					Here goes the content
				</div>
			</div>
		</div>
		......... 
	</div>
</div>

Feedback

Please open an issue to request a feature or submit a bug report. Or even if you just want to provide some feedback, I'd love to hear. I'm also available on Twitter as @imelgrat.

Contributing

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Added some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create a new Pull Request.

Links

tab-collapse's People

Contributors

imelgrat avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.