|
1 | 1 | # GridTab jQuery Plugin #
|
2 | 2 |
|
3 | 3 |
|
4 |
| -**GridTab** is a lightweight jQuery plugin to create grid based responsive tabs. |
| 4 | +**GridTab** is a lightweight jQuery plugin to create grid based responsive tabs. With version 2.0.0, gridtab supports nested tabs. |
5 | 5 |
|
6 | 6 | ## Demo ##
|
7 | 7 |
|
@@ -56,22 +56,40 @@ and initialize the plugin as shown below:
|
56 | 56 | Where grid is the number of grids/tabs in a row
|
57 | 57 |
|
58 | 58 | ## Settings ##
|
59 |
| -| Option | Type | Default | Description | |
60 |
| -| ------------- | ------------- | -------- | ----------- | |
61 |
| -| grid | integer | 4 | Number of grids or tabs per row | |
62 |
| -| borderWidth | integer | 2 | Width of the borders | |
63 |
| -| tabBorderColor | string | '#ddd' | border color of the tabs (Hex Color Code).| |
64 |
| -| tabPadding | integer | 25 | padding/spacing around the tabs. |
65 |
| -| contentBorderColor | string | '#ddd' | border color of the content section (Hex Color Code).| |
66 |
| -| contentPadding | integer | 25 | padding/spacing around content section| |
67 |
| -| contentBackground | string | '#fff' | Background color for the content section (Hex Color Code).| |
68 |
| -| activeTabBackground| string | '#fff' | Background color for the active tab (Hex Color Code).| |
69 |
| -| keepOpen | Boolean | false | If set to `true` keeps the active tab open (Disables toggle).| |
70 |
| -| speed | integer | 500 | Transition speed in milliseconds| |
71 |
| -| layout | string | 'grid' | Change the value to `'tab'` for a tab layout. By default, the layout is `'grid'` based.| |
72 |
| -| activeTab | integer | 0 | Initially active tab. For example, `1` enables the first tab.| |
73 |
| -| Responsive | Array | null | Array of objects having breakpoints and `settings` object which is enabled at a given `breakpoint`.| |
74 |
| -| callbacks | Object | open:false, close:false| Callbacks for the open and close states of the content section.| |
| 59 | +| Basic Settings | Type | Default | Description | |
| 60 | +| ------------- | ------------- | -------- | ----------- | |
| 61 | +| grid | integer | `4` | Number of grids or tabs per row | |
| 62 | +| borderWidth | integer | `2` | Width of the borders.| |
| 63 | +| tabBorderColor | string | `'#ddd'` | border color of the tabs (Hex Color Code).| |
| 64 | +| tabPadding | integer | `25` | padding/spacing around the tabs. |
| 65 | +| contentBorderColor | string | `'#ddd'` | border color of the content section (Hex Color Code).| |
| 66 | +| contentPadding | integer | `25` | padding/spacing around content section.| |
| 67 | +| contentBackground | string | `'#fff'` | Background color for the content section (Hex Color Code).| |
| 68 | +| activeTabBackground| string | `'#fff'` | Background color for the active tab (Hex Color Code).| |
| 69 | +| responsive | Array | `null` | Array of objects having breakpoints and `settings` object which is enabled at a given `breakpoint`.| |
| 70 | +| selectors | Object | see table below | Object with options to set custom selectors.| |
| 71 | +| config | Object | see table below | Object with options to enable features like, setting initially active tab, next/prev controls, close button, transition speed etc.| |
| 72 | +| callbacks | Object | `open:false, close:false` | Callbacks for the open and close states of the content section.| |
| 73 | + |
| 74 | + |
| 75 | +| selectors | Type | Default | Description | |
| 76 | +| ------------- | ------------- | -------- | ----------- | |
| 77 | +| tab | string | `'> dt'` | By default, the click event is triggered on the entire tab (`'dt'`). This can be replaced with any custom selector within the `dt`. For example: `'.readmore'`.| |
| 78 | +| closeButton | string | `'.gridtab__close'` | Custom class for the close button, if `'showClose'` is set to `true`.| |
| 79 | +| nextArrow | string | `'.gridtab__next.gridtab__arrow'` | Custom class for the next button, if `'showArrows'` is set to `true`. | |
| 80 | +| prevArrow | string | `'.gridtab__prev.gridtab__arrow'` | Custom class for the prev button, if `'showArrows'` is set to `true`. | |
| 81 | +| disabledArrow | string | `'.is-disabled'` | Custom class for the disabled state of next/prev buttons, if `'showArrows'` is set to `true`. | |
| 82 | + |
| 83 | +| config | Type | Default | Description | |
| 84 | +| ------------- | ------------- | -------- | ----------- | |
| 85 | +| layout | string | `'grid'` | Change the value to `'tab'` for a tab layout. By default, the layout is `'grid'` based. | |
| 86 | +| keepOpen | Boolean | `false` | If set to `true` keeps the active tab open (Disables toggle).| |
| 87 | +| speed | integer | `500` | Transition speed in milliseconds.| |
| 88 | +| activeTab | integer | `0` | Initially active tab. For example, `1` enables the first tab.| |
| 89 | +| showClose | Boolean | `false` | Shows the close button if set to `true`.| |
| 90 | +| showArrows | Boolean | `false` | Shows the next/prev buttons if set to `true`.| |
| 91 | +| scrollToTab | Boolean | `false` | Scrolls to the active tab on click| |
| 92 | + |
75 | 93 |
|
76 | 94 | ### Responsive Example ###
|
77 | 95 | The responsive settings is where you reset the grids and other properties at a given breakpoint.
|
@@ -101,10 +119,11 @@ $('#gridtab-1').gridtab({
|
101 | 119 | }]
|
102 | 120 | });
|
103 | 121 | ```
|
104 |
| -The properties that can be changed with the responsive settings are: `borderWidth`, `tabPadding`, `tabBorderColor`, `contentBorderColor`, `contentPadding`, `contentBackground` and `activeTabBackground`. |
| 122 | +All properties under basic settings like: `borderWidth`, `tabPadding`, `tabBorderColor`, `contentBorderColor`, `contentPadding`, `contentBackground` and `activeTabBackground`, can be updated with the responsive settings. |
| 123 | + |
105 | 124 | ## Version ##
|
106 | 125 |
|
107 |
| -1.0.0 |
| 126 | +2.0.0 |
108 | 127 | ## Browser support ##
|
109 | 128 |
|
110 | 129 | GridTab works on IE10+ in addition to other modern browsers like Chrome, Firefox and Safari
|
|
0 commit comments