Adding option for calculating item widths with js