Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
* jQuery hasScrollBar plugin ver 0.0.1
* Copyright (c) 2014 tanatana (a.k.a @side_tana)
* This source file is subject to the MIT license.
*/
(function($) {
$.fn.hasScrollBarY = function(options){
var innerWidth = this.innerWidth();
var clientWidth = this[0].clientWidth;
if(innerWidth == clientWidth){
return false;
}
return true;
};
$.fn.hasScrollBarX = function(options){
var innerHeight = this.innerHeight();
var clientHeight = this[0].clientHeight;
if(innerHeight == clientHeight){
return false;
}
return true;
};
$.fn.hasScrollBar = function(options){
return {x: this.hasScrollBarX(), y: this.hasScrollBarY()};
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment