dimension-based js