Skip to content

Commit

Permalink
Added option to disable swiping on NoSwiping class
Browse files Browse the repository at this point in the history
Elements with class NoSwiping will not be able to change Swiper slides.
  • Loading branch information
X4arms committed Apr 12, 2013
1 parent 805be7a commit 939eebf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dev/idangerous.swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var Swiper = function (selector, params, callback) {
nopeek : false,
scrollContainer : false,
preventLinks : true,
preventClassNoSwiping : true,
initialSlide: 0,
keyboardControl: false,
mousewheelControl : false,
Expand Down Expand Up @@ -789,6 +790,9 @@ var Swiper = function (selector, params, callback) {
if (_this.isTouched || params.onlyExternal) {
return false
}

if (params.preventClassNoSwiping && event.target.className.indexOf('NoSwiping') > -1) return false;

//Check For Nested Swipers
_this.isTouched = true;
isTouchEvent = event.type=='touchstart';
Expand Down

0 comments on commit 939eebf

Please sign in to comment.