davatron5000 / FitText.js

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

Fonts are resizing on change slide #159

Closed SufyanRamzan closed 8 years ago

SufyanRamzan commented 8 years ago

Hi, Fonts are resizing on change slide. i am using twitter bootstrap.

jQuery(".fittext").fitText(1.1, { minFontSize: '16px', maxFontSize: '30px' });

jQuery('#notification-slider').carousel();
jQuery(".portlet-notification .left").click(function () {
    jQuery("#notification-slider").carousel("prev");
});
jQuery(".portlet-notification .right").click(function () {
    jQuery("#notification-slider").carousel("next");
});

jQuery('#notification-slider').bind('slide.bs.carousel', function (e) {
    jQuery(this).find('.fittext').fitText(1.1, { minFontSize: '16px', maxFontSize: '30px' });
});
davatron5000 commented 8 years ago

Common problem. Run FitText before initializing the carousel. https://github.com/davatron5000/FitText.js#css-faq