Fix global variable by declaring x
Attach resize event with addEventListener
Merge pull request #11 from vsr/master

Attach resize event with addEventListener