From 99911aaf8acd9ab70596936ae0efa3af60281c42 Mon Sep 17 00:00:00 2001 From: Dominique St-Amand Date: Sun, 12 Feb 2017 22:01:53 -0500 Subject: [PATCH] Update for jQuery3 - *bind jQuery3 has deprecated bind/unbind - changed the bind/unbind to on/off --- jquery.slimscroll.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jquery.slimscroll.js b/jquery.slimscroll.js index 90caed3..34139d6 100644 --- a/jquery.slimscroll.js +++ b/jquery.slimscroll.js @@ -220,24 +220,24 @@ // make it draggable and no longer dependent on the jqueryUI if (o.railDraggable){ - bar.bind("mousedown", function(e) { + bar.on("mousedown", function(e) { var $doc = $(document); isDragg = true; t = parseFloat(bar.css('top')); pageY = e.pageY; - $doc.bind("mousemove.slimscroll", function(e){ + $doc.on("mousemove.slimscroll", function(e){ currTop = t + e.pageY - pageY; bar.css('top', currTop); scrollContent(0, bar.position().top, false);// scroll content }); - $doc.bind("mouseup.slimscroll", function(e) { + $doc.on("mouseup.slimscroll", function(e) { isDragg = false;hideBar(); - $doc.unbind('.slimscroll'); + $doc.off('.slimscroll'); }); return false; - }).bind("selectstart.slimscroll", function(e){ + }).on("selectstart.slimscroll", function(e){ e.stopPropagation(); e.preventDefault(); return false; @@ -269,7 +269,7 @@ }); // support for mobile - me.bind('touchstart', function(e,b){ + me.on('touchstart', function(e,b){ if (e.originalEvent.touches.length) { // record where touch started @@ -277,7 +277,7 @@ } }); - me.bind('touchmove', function(e){ + me.on('touchmove', function(e){ // prevent scrolling the page if necessary if(!releaseScroll) {