Compatible with mainstream browser js rotation code