Improvement on js code (remove fixed width values from css)