replace media query with javascript to avoid rendering bug