2017 © Pedro Peláez
 

jquery-plugin autotabs

JQuery plugin to generate tabs from page markup

image

opichon/autotabs

JQuery plugin to generate tabs from page markup

  • Tuesday, October 20, 2015
  • by opichon
  • Repository
  • 1 Watchers
  • 3 Stars
  • 49 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 21 Versions
  • 0 % Grown

The README.md

jquery.autotabs.js - A jquery plugin that automatically generates navigable tabs based on the markup in the page.

jquery.autotabs.js automatically generates tabs based on the markup in your DOM element to which it is applied., (*1)

A tab is created for each child element in the designated element. Which children are used to generate tabs can be customized., (*2)

A set of navigable tabs is added to the page. The location of the tabs is cusotmizable., (*3)

Each tab can contain either static or dynamic content., (*4)

See demo/docs in docs/index.html., (*5)

Requirements

  • jQuery >= 1.9.1

If you want autotabs to remember the state of you tabs, you also need the jquery.cookie plugin:, (*6)

  • jquery.cookie.js: >= 1.4

Installation

Installation via bower

Add the following lines to your bower.json configuration:, (*7)

```` json "dependencies": { "autotabs": "~2.0", }, (*8)


### Download Or download from: * http://plugins.jquery.com/autotabs/ * https://github.com/opichon/autotabs Setup ----- ### javascripts ````html <script src="../dist/js/jquery.js"></script> <script src="../dist/js/jquery.cookie.js"></script> <!-- optional --> <script src="../dist/js/jquery.autotabs.min.js"></script>

stylesheets

    <link rel="stylesheet" type="text/css" href="../dist/css/jquery.autotabs.min.css" />

For vertical tabs, include the custom stylesheet provided:, (*9)

    <link rel="stylesheet" type="text/css" href="../dist/css/jquery.autotabs.vertical.min.css" />

Add the following logic to your page or to a plugin included to your page:, (*10)

$( "#mytabs" ).autotabs(/* { options } */));

Markup options

The tabs settings can be configured directly inside the markup. The following attributes are supported:, (*11)

data-autotabs-label

The tab label., (*12)

data-autotabs-url

The remote url for the tab content., (*13)

title

The tab label., (*14)

This attribute is deprecated in favour of the data-autotabs-label attribute and may be removed in future releases., (*15)

rel (deprecated)

The remote url for the tab content., (*16)

This attribute is deprecated in favour of the data-autotabs-url attribute and may be removed in future releases., (*17)

How-to

Load a tab pane's content dynamically via ajax

Simply set the data-autotabs-url attribute of the tab pane to the url of the page holding the content., (*18)

Style tabs via bootstrap

To style the tabs with the bootstrap stylesheet, use the following options:, (*19)

tabs_class: "nav nav-tabs",
tab_class: null,
active_class: "active"

To style the tabs as pills:, (*20)

tabs_class: "nav nav-pills",
tab_class: null,
active_class: "active"

Plugin options

tab_pane_selector

Defines the selector for identifying tab panes., (*21)

Default value: div, section, .tab-pane, (*22)

tab_label_selector

Defines the selector for identifying the label/title of the tab from an element of the tab pane., (*23)

Default value: h1, h2, h3, h4, (*24)

tabs_class

The CSS class to set on the generated tabs element., (*25)

Default value: autotabs, (*26)

tab_class

The CSS class ot set on each generated tab element, (*27)

Default value: autotab, (*28)

tabs_selector

The selector for identifying the element in which the generated tabs should be appended., (*29)

Default value: none, (*30)

active_class

The CSS class to add to the tab currently selected., (*31)

Default value: current, (*32)

active_tab

The index of the tab to set as active when the plugin loads., (*33)

Default value: null, (*34)

The name of the cookie in which to store the state of the tabs. This option requires the jquery.cookie.js plugin., (*35)

Default value: active_tab, (*36)

The path to set on the cookie. This option requires the jquery.cookie.js plugin., (*37)

Default value: /, (*38)

force_refresh

Forces each tab to be refreshed when clicked., (*39)

Default value: false, (*40)

tab_orphans:

Whether to treat an single (orphan) tab-pane as a tab or not., (*41)

Default value: false, (*42)

loading_icon

The selector for the element containing the loading icon., (*43)

Default value: #loading, (*44)

tab_id

A function responsible for generating a tab id if not suplied in the markup., (*45)

Default value:, (*46)

function( id ) { return "__" + id; }

tab_label

A function responsible for generating each tab's label ifnot supplied in the markup., (*47)

Default value:, (*48)

function( index ) { return "Tab " + ( index + 1 ); },

tab_pane_id

A function responsible for generating the id of each tab pane if not supplied in the markup., (*49)

Default value:, (*50)

function( index ) { return "___" + ( index + 1 ); },

vertical

Whether the tabs are vertically aligned., (*51)

Default value: false, (*52)

success

Defines the callbacks to apply when a tab is clicked. This option can be, (*53)

  • a function, in which case it is applied to all tabs
  • an object, where the property is the id of a tab, and the value the function to act as callback for that tab.

All functions are applied to the tab pane element. this therefore refers to the tab pane element., (*54)

The Versions

20/10 2015

dev-master

9999999-dev https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

20/10 2015

2.1.3

2.1.3.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

22/08 2014

2.1.2

2.1.2.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

21/08 2014

2.1.1

2.1.1.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

21/08 2014

2.1.0

2.1.0.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

11/06 2014

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

11/06 2014

2.0.14

2.0.14.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

08/06 2014

2.0.13

2.0.13.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

11/05 2014

2.0.12

2.0.12.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

22/09 2013

2.0.11

2.0.11.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

26/05 2013

2.0.10

2.0.10.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

26/05 2013

2.0.9

2.0.9.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

20/05 2013

2.0.8

2.0.8.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

20/05 2013

2.0.7

2.0.7.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

20/05 2013

2.0.6

2.0.6.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

20/05 2013

2.0.5

2.0.5.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

13/11 2012

dev-develop

dev-develop https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

10/11 2012

2.0.4

2.0.4.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

10/11 2012

2.0.3

2.0.3.0 https://github.com/opichon/autotabs

JQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

06/11 2012

2.0.2

2.0.2.0 https://github.com/opichon/autotabs

jQuery plugin to generate tabs from page markup

  Sources   Download

MIT

by Olivier Pichon

jquery tabs autotabs

02/11 2012

2.0.1

2.0.1.0 https://github.com/opichon/autotabs

jQuery plugin to generate tabs from page markup

  Sources   Download

by Olivier Pichon

jquery tabs autotabs