Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 37 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ Just use the normal Bootstrap Nav-tab construction, adding the `horizontal-scrol

It's also possible to add arrows for extra control, but touch events will work to scroll horizontally the tab.

````html
<div class="row">
<div class="col-xs-12">
<div id="js_image_selection" class="horizontal-scrollable-tabs">
<!-- Added for controls (will be invisible on bigger viewports) - touch/swipe/dragging does work though -->
<div class="scroller arrow-left"><i class="fa fa-arrow-left"></i></div>
<div class="scroller arrow-right"><i class="fa fa-arrow-right"></i></div>
<div class="horizontal-tabs">
<!-- nav-tabs-horizontal added for the style -->
<ul role="tablist" class="nav nav-tabs nav-tabs-horizontal">
<!-- Normal bootstrap tabs -->
<li role="presentation" class="active"><a href="#image01" data-toggle="tab">Tab 1</a></li>
<li role="presentation"><a href="#image02" data-toggle="tab">Tab 2</a></li>
</ul>
</div>
</div>
</div>
```html
<div class="row">
<div class="col-xs-12">
<div id="js_image_selection" class="horizontal-scrollable-tabs">
<!-- Added for controls (will be invisible on bigger viewports) - touch/swipe/dragging does work though -->
<div class="scroller arrow-left"><i class="fa fa-arrow-left"></i></div>
<div class="scroller arrow-right"><i class="fa fa-arrow-right"></i></div>
<div class="horizontal-tabs">
<!-- nav-tabs-horizontal added for the style -->
<ul role="tablist" class="nav nav-tabs nav-tabs-horizontal">
<!-- Normal bootstrap tabs -->
<li role="presentation" class="active"><a href="#image01" data-toggle="tab">Tab 1</a></li>
<li role="presentation"><a href="#image02" data-toggle="tab">Tab 2</a></li>
</ul>
</div>
````
</div>
</div>
</div>
```

## Motivation

Expand All @@ -41,30 +41,35 @@ Whilst developing a mobile commerce website there was the need for a product gal
## Installation

Simply apply the stylesheet and the js to your project and import it on your HTMl as such:

On the header the StyleSheet
````html
<link href="bootstrap-nav-tab-scrollable.css" rel="stylesheet">
````

```html
<link href="bootstrap-nav-tab-scrollable.css" rel="stylesheet">
```

Before closing the body import and execute:
````html
<!-- Import the component -->
<script src="bootstrap-nav-tab-scrollable.js"></script>
<!-- Execute the plugin -->
<script type="text/JavaScript">
$("#js_image_selection").horizontalTabs();
</script>
````

```html
<!-- Import the component -->
<script src="bootstrap-nav-tab-scrollable.js"></script>
<!-- Execute the plugin -->
<script type="text/JavaScript">
$("#js_image_selection").horizontalTabs();
</script>
```

## API Reference

Currently, there is only one option, to initialize the horizontal tabs. As such:

### Initialize

Call it after the element was rendered.
`````javascript
$("#ID_OF_ELEMENT").horizontalTabs();
````

```javascript
$("#ID_OF_ELEMENT").horizontalTabs();
```


## Contributors
Expand Down