caching width and height
separate method that adding resize event and use window.resize instead of setInterval
fixed jshint error
unify the variables name
Merge branch 'master' into temp