Closed disparvulgo closed 11 years ago
How are you invoking the fittext script? You should probably be doing it every time the page loads. With jQuery, place your code in $(document).ready(function{ }). Hope that helps!
-Arie
On Sep 5, 2012, at 11:49 AM, disparvulgo notifications@github.com wrote:
I'm new in this people, so please don't shoot me. I'm working on a responsive website. The problem is that when I resize my window everything is allright. But then when I switch to another page in a resized window the font-size is in default. When I just move the resized window a tiny bit it switches back to the font-size it supossed to be.
Anyone???
— Reply to this email directly or view it on GitHub.
I have a feeling that you're invoking fittext somewhere in the DOM tree that conflicts with another script or process. Are you using any other plugins or scripts?
I also tried it with the $(document).ready(function{ }) with the same result. I'm using a responsive slider on the homepage. Allready big thanks for helping!
Same issue. I'm using FitText inside of Flexslider. on page load the font size is really small. But upon inspection (firebug, chrome dev tools) and even resize, the font size value jumps to size proportionally to the window.
So when you're using FitText inside of a slider, invisible elements have no height/width, so FitText can't make any calculations because there's no data or numbers to calculation. There's a few things you can do with regards to execution.
display: none
'd$(window).trigger('resize');
via a callback on the slider.From a feature standpoint, I may include a custom fittext-resize event that you could trigger. But that's probably a bit off.
Thanks for the support!
Callback via the slider to
start: function () {
$(window).trigger('resize');
}
Awesome plugin by the way ;)
If any one used it with siperslides this is how it works for me
$(document).on('animated.slides', function(a){
setTimeout(function(){
$('.fittext').fitText(1.78, { minFontSize: '16px', maxFontSize: '60px' });
}, 100)
});
$(document).on('animating.slides', function(a){
setTimeout(function(){
$('.fittext').fitText(1.78, { minFontSize: '16px', maxFontSize: '60px' });
}, 100)
});
@ahmadajmi thanks that saved me some time.
I'm new in this people, so please don't shoot me. I'm working on a responsive website. The problem is that when I resize my window everything is allright. But then when I switch to another page in a resized window the font-size is in default. When I just move the resized window a tiny bit it switches back to the font-size it supossed to be.
Anyone???