davatron5000/FitText.js — Issue #14: possible to include orientation change?
Author: nosarious
Created: 2011-11-05 17:27:29+00:00
State: open

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.