Put the position in JS instead of CSS

I messed up with the CSS position so I guess is easier to do it in JS directly.