davatron5000 / FitText.js

A jQuery plugin for inflating web type
http://fittextjs.com
6.75k stars 1.39k forks source link

onorientationchange not working correctly #134

Closed Strydom closed 9 years ago

Strydom commented 9 years ago

Hi, I seem to be having a problem on mobile devices when the orientation is changed.

Say it's portrait, the text is smaller and then I turn the phone around to landscape the text should enlarge but instead it stays the same size. When I then turn the phone back around to portrait the text enlarges.

It's as if the script is behind an orientation so it thinks landscape is portrait and vice versa or it just doesn't register the first time.

TrentWalton commented 9 years ago

Hiya! Could you maybe throw together an isolated test case on codepen?

Strydom commented 9 years ago

I have set up the code pen but I haven't used it before and couldn't get your plugin to work with it, maybe you could give it a go?

http://codepen.io/anon/pen/YXwPag

davatron5000 commented 9 years ago

Forked and updated your pen, tested in iOS Simulator got it working as expected: http://codepen.io/davatron5000/full/EjPKGq

I had to do two things: