davatron5000 / FitText.js

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

possible to include orientation change? #14

Closed nosarious closed 11 years ago

nosarious commented 13 years ago

I noticed this plugin relies on $(window).resize to do it's magic.

Unfortunately this does not seem to work properly with iPad orientation change.

I have a resizing script on my site which recalculates several sizes for divs to centre images. This is called with several options:

jQuery.event.add(window, "orientationchange", reCalculateFunction); jQuery.event.add(window, "load", reCalculateFunction); jQuery.event.add(window, "resize", reCalculateFunction);

and if I include a fittext call within this function, it will now update properly on orientation change.

I'm not sure if this system will add to a memory leak or not, but having a way for your plugin to include $(window).orientationchange or the equivalent would be very, very nice.

(note, adding this to the fittest plugin does not work, since query $(window) does not have an orientation change event handler thingie.)

Gerry.

alistairtweedie commented 12 years ago

Hi Gerry,

This may solve a problem I've having but trying to understand where exactly to put this is the doc to get it to work. Any help would be great.

Thanks

davatron5000 commented 12 years ago

I can probably work this in. Will do in the near future.