Add feature to suport ie.

For ie browser, the `.ps-container` element will add extra class `ie`
and `ie<version>`, like `ie6`, `ie7`, `ie8`, etc.
This commit is contained in:
maoziliang 2013-06-11 23:44:36 +08:00 committed by Hyunje Alex Jun
parent 37210ee453
commit e93d67e754

View File

@ -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();