simplefocus / FlowType.JS

Web typography at its finest: font-size and line-height based on element width.
http://simplefocus.com/flowtype/
MIT License
4.61k stars 455 forks source link

Flowtype inside Modal Window #13

Open kaspar-allenbach opened 10 years ago

kaspar-allenbach commented 10 years ago

Hi. I have a Textelement inside a Bootstrap modal window.

When I open the modal window, the element isn't beeing resized. Flowtype doesn't fire up unless I resize the browser window. Then flowtape resizes the element correctly but not without resizing the window.

I guess flowtype should be triggered when the modal dialog is triggered? Not before. How do I do that? I just trigger flowtype on document.ready.

Alex-Sokolov commented 10 years ago

Maybe init FlowType on shown event for modal?

$('#myModal').on('shown.bs.modal', function () {
   $('#modalbody').flowtype({
      minimum : 500,
      maximum : 1200
   });
});
kaspar-allenbach commented 10 years ago

Oh sorry. It's not inside a bootstrap modal but in the magnific popup lightbox plugin.

Alex-Sokolov commented 10 years ago

From documentation (http://dimsemenov.com/plugins/magnific-popup/documentation.html)

To modify content after it’s loaded, or to select and show just specific element from loaded file, there is a parseAjax callback

Trying init FlowType in callback function