Handle change on resize (makes it work in firefox on mobile)