Closed janheinrichmerker closed 9 years ago
i think i have a good fix for you
call the resizer inside on the parent element:
$('#containing-element').on('resize.fittext orientationchange.fittext', resizer);
just inside the closing curly braces of the function started on line 15
should do the trick for you.
The best we could do with JavaScript is listen for the transitionend
event when the transition is over.
http://codepen.io/davatron5000/pen/bNdRwa
$('div').on('transitionend', function(){ $(document).trigger('resize'); });
For me, this is a subpar effect and I wouldn't want to build that behavior in. I'd probably recommend using plain ol' CSS transform: scale(1.5)
. I added a div.scale
demo to my fork of the CodePen.
Text size not updating when width is changing in CSS Example: http://cdpn.io/ImrcJ (hover over the blue box to see the effect)