Skip to content

Instantly share code, notes, and snippets.

@winwu
Created January 26, 2016 06:26
Show Gist options
  • Save winwu/2e941a5aca17d350eb4f to your computer and use it in GitHub Desktop.
Save winwu/2e941a5aca17d350eb4f to your computer and use it in GitHub Desktop.
scrollbaranddeletectie.js
// http://stackoverflow.com/questions/19999388/check-if-user-is-using-ie-with-jquery
function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
// IE 10 or older => return version number
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
}
var trident = ua.indexOf('Trident/');
if (trident > 0) {
// IE 11 => return version number
var rv = ua.indexOf('rv:');
return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
}
var edge = ua.indexOf('Edge/');
if (edge > 0) {
// Edge (IE 12+) => return version number
return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
}
// other browser
return false;
}
$(document).ready(function(){
$('#container').perfectScrollbar();
$('.page-container .row .col-link').perfectScrollbar();
$('.list.page-container .row .page-main-content').perfectScrollbar();
$('#slideoutMenu').perfectScrollbar();
if(+detectIE() == 9) {
$('.position-fix').perfectScrollbar(); //ie9
}
//bal~bal~bal~bal~bal~bal~
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment