index.js optimalisation 

I defined jQuery objects once instead of multiple times, removed unnecessary whitespace and semicolons.