Fix initialisation problems.
This commit is contained in:
parent
e1443282ac
commit
39aa43eb6f
11
shower.js
11
shower.js
|
@ -11,8 +11,7 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
progress = [],
|
progress = [],
|
||||||
slideList = [],
|
slideList = [],
|
||||||
timer,
|
timer,
|
||||||
isHistoryApiSupported = !!(window.history && history.pushState),
|
isHistoryApiSupported = !!(window.history && history.pushState);
|
||||||
l = slides.length, i;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get value at named data store for the DOM element.
|
* Get value at named data store for the DOM element.
|
||||||
|
@ -37,9 +36,9 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
|
|
||||||
slides = document.querySelectorAll(slideSelector);
|
slides = document.querySelectorAll(slideSelector);
|
||||||
progress = document.querySelector(progressSelector);
|
progress = document.querySelector(progressSelector);
|
||||||
slideList = [],
|
slideList = [];
|
||||||
|
|
||||||
for (i = 0; i < l; i++) {
|
for (var i = 0; i < slides.length; i++) {
|
||||||
// Slide IDs are optional. In case of missing ID we set it to the
|
// Slide IDs are optional. In case of missing ID we set it to the
|
||||||
// slide number
|
// slide number
|
||||||
if ( ! slides[i].id) {
|
if ( ! slides[i].id) {
|
||||||
|
@ -701,6 +700,8 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
shower.init();
|
||||||
|
|
||||||
document.addEventListener('click', function(e) {
|
document.addEventListener('click', function(e) {
|
||||||
var slideNumber = shower.getSlideNumber(shower._getSlideIdByEl(e.target));
|
var slideNumber = shower.getSlideNumber(shower._getSlideIdByEl(e.target));
|
||||||
|
|
||||||
|
@ -740,8 +741,6 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
shower.init();
|
|
||||||
|
|
||||||
return shower;
|
return shower;
|
||||||
|
|
||||||
})(this, this.document);
|
})(this, this.document);
|
||||||
|
|
Loading…
Reference in New Issue