Skip to content

Commit ad7b59b

Browse files
committed
option to specify the initial item when creating a swipebox from an array
1 parent 1faee3b commit ad7b59b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ $(".swipebox").swipebox();
6060

6161
```javascript
6262
useCSS : true, // false will force the use of jQuery for animations
63+
initialIndexOnArray: 0, // which image index to init when a array is passed
6364
hideBarsDelay : 3000, // 0 to always show caption and action bar
6465
videoMaxWidth : 1140, // videos max width
6566
beforeOpen: function(){} , // called before opening

source/jquery.swipebox.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
var defaults = {
1616
useCSS : true,
17+
initialIndexOnArray : 0,
1718
hideBarsDelay : 3000,
1819
videoMaxWidth : 1140,
1920
vimeoColor : 'CCCCCC',
@@ -50,7 +51,7 @@
5051

5152
elements = elem;
5253
ui.target = $(window);
53-
ui.init(0);
54+
ui.init(plugin.settings.initialIndexOnArray);
5455

5556
}else{
5657

source/jquery.swipebox.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)