Use JS to calculatute pixel dim/position