- Created method onResize for adjust the bar when event resize is trigger, this recalculate the position