diff --git a/src/snap/snap.js b/src/snap/snap.js index ebed8a37..bc883202 100644 --- a/src/snap/snap.js +++ b/src/snap/snap.js @@ -2,8 +2,10 @@ _initSnap: function () { this.currentPage = {}; - if ( typeof this.options.snap == 'string' ) { - this.options.snap = this.scroller.querySelectorAll(this.options.snap); + this.options.snapSelector = this.options.snapSelector || this.options.snap; + + if ( typeof this.options.snapSelector == 'string' ) { + this.options.snap = this.scroller.querySelectorAll(this.options.snapSelector); } this.on('refresh', function () { @@ -18,6 +20,10 @@ this.pages = []; + if ( typeof this.options.snapSelector == 'string' ) { + this.options.snap = this.scroller.querySelectorAll(this.options.snapSelector); + } + if ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) { return; }