diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 2121905..9bf04f3 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -307,9 +307,19 @@ $this.data('perfect-scrollbar-destroy', null); }; + var ieSupport = function (version) { + $this.addClass('ie').addClass('ie' + version); + }; + var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent); var initialize = function () { + var ieMatch = navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/); + if (ieMatch && ieMatch[1] === 'msie') { + // must be executed at first, because 'ieSupport' may addClass to the container + ieSupport(parseInt(ieMatch[2], 10)); + } + updateBarSizeAndPosition(); bindMouseScrollXHandler(); bindMouseScrollYHandler();