diff --git a/showup.js b/showup.js index 39b7fde..16516ad 100644 --- a/showup.js +++ b/showup.js @@ -111,7 +111,9 @@ * @return-{boolean} */ var hasClass = function (className) { - return this.className.indexOf(className) > -1; + var regex = new RegExp('(^| )' + className + '($| )'); + + return regex.test(this.className); };