Skip to content

Commit

Permalink
add gutter option
Browse files Browse the repository at this point in the history
  • Loading branch information
ganlanyuan committed Sep 20, 2016
1 parent 4d3b48d commit bf3544e
Show file tree
Hide file tree
Showing 25 changed files with 437 additions and 144 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#.env
COMPOSE_HTTP_TIMEOUT=36000
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tiny-slider
![version](https://img.shields.io/badge/Version-0.3.5-green.svg)
![version](https://img.shields.io/badge/Version-0.4.0-green.svg)
Tiny slider for all purposes, inspired by [Owl Carousel](http://owlcarousel.owlgraphic.com/).
Works on morden browsers and IE8+.
[demo](http://creatiointl.org/william/tiny-slider/v1/demo/)
Expand Down Expand Up @@ -32,7 +32,7 @@ Include tiny-slider
```html
<link rel="stylesheet" href="tiny-slider.css">

<!--[if (lt IE 9)]><script src="tiny-slider.helper.ie8.js"></script><![endif]-->
<!--[if (lt IE 9)]><script src="tiny-slider.ie8.js"></script><![endif]-->
<script src="tiny-slider.js"></script>
```
Or tiny-slider.native + [go-native](https://github.com/ganlanyuan/go-native),
Expand Down Expand Up @@ -89,6 +89,7 @@ Default:
{
container: document.querySelector('.slider'),
items: 1,
gutter: 0,
fixedWidth: false,
maxContainerWidth: false,
slideByPage: false,
Expand All @@ -111,14 +112,11 @@ Default:
}
```

#### * Padding
There is no option for `padding`, but you can add it by css
```css
.tiny-slider { margin-right: -10px; }
.your-slider > div { padding-right: 10px; }
```
#### Padding
<del>There is no option for `padding`, but you can add it by css </del>
Now you can set the gutter using `gutter` option.

#### * Non-javascirpt fallback
#### Fallback
```css
.no-js .your-slider {
overflow-x: auto;
Expand Down
8 changes: 3 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"name": "tiny-slider",
"version": "0.3.5",
"version": "0.4.0",
"homepage": "https://github.com/ganlanyuan/tiny-slider",
"authors": [
"WilliamLin <[email protected]>"
],
"description": "Tiny slider for all purposes.",
"main": [
"src/tiny-slider.scss",
"dist/tiny-slider.helper.ie8.js",
"dist/tiny-slider.native.js",
"dist/tiny-slider.css",
"dist/tiny-slider.js"
],
"moduleType": [],
Expand All @@ -26,7 +24,7 @@
"tests"
],
"devDependencies": {
"go-native": "0.0.3"
"go-native": "0.0.8"
},
"dependencies": {}
}
7 changes: 6 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Changelog
# Changelog

<!-- #### v1.0.0 beta
- Totally rewrite with a simple function, co-work with [go-native](https://github.com/ganlanyuan/go-native).
Expand Down Expand Up @@ -26,6 +26,11 @@ class `tiny-next` => attribute `[data-controls="next"`.
- Fixed: an issue that navs are still active when slides cann't fill their parent.
- Fixed: an issue with `items`, when container width is shorter than one slide in fixedWidth slider.
-->

#### v0.4.0
- Added: `gutter` option.
- Renamed `tiny-slider.helper.ie8.js` to `tiny-slider.ie8.js`.

#### v0.3.5
- Fix a `package.json` issue.

Expand Down
14 changes: 11 additions & 3 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@
button[aria-selected="true"] { background: #999; }
</style>
<script src="prism/prism.js"></script>
<script src="../dist/tiny-slider.helper.ie8.js"></script>
<script src="../dist/tiny-slider.js"></script>
<script src="../dist/min/tiny-slider.ie8.js"></script>
<script src="../dist/min/tiny-slider.js"></script>
<script type="text/javascript">
gn.ready(function () {
tinySlider({
container: document.querySelector('.responsive'),
gutter: 10,
responsive: {
500: 2,
800: 3,
Expand All @@ -138,6 +139,7 @@

tinySlider({
container: document.querySelector('.fixed-width'),
gutter: 10,
fixedWidth: 200,
maxContainerWidth: 900,
loop: false
Expand All @@ -146,6 +148,7 @@
tinySlider({
container: document.querySelector('.customize'),
items: 3,
gutter: 10,
controlsContainer: document.querySelector('.slider-controls'),
navContainer: document.querySelector('.thumbnails'),
lazyload: true
Expand All @@ -154,19 +157,22 @@
tinySlider({
container: document.querySelector('.non-loop'),
items: 3,
gutter: 10,
loop: false
}).init();

tinySlider({
container: document.querySelector('.slide-by-page'),
items: 3,
gutter: 10,
slideByPage: true
}).init();

tinySlider({
container: document.querySelector('.autoplay'),
items: 3,
autoplay: true,
gutter: 10,
speed: 300,
autoplayTimeout: 3000,
autoplayText: ['▶', '❚❚']
Expand All @@ -175,12 +181,14 @@
tinySlider({
container: document.querySelector('.arrow-keys'),
items: 3,
gutter: 10,
arrowKeys: true
}).init();

tinySlider({
container: document.querySelector('.auto-height'),
autoHeight: true,
gutter: 10,
items: 1
}).init();
});
Expand Down Expand Up @@ -525,7 +533,7 @@ <h2>arrow keys</h2>
<h2>auto height</h2>
<div class="auto-height">
<div>
<img src="" alt="">
<img src="http://lorempixel.com/900/400/city?2" alt="">
<p>Lorem ipsum dolor sit amet</p>
</div>
<div>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/min/tiny-slider.js

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions dist/min/tiny-slider.min.js

This file was deleted.

Loading

0 comments on commit bf3544e

Please sign in to comment.