Created
January 17, 2014 22:31
-
-
Save tanatana/8482881 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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