STRML / textFit

A jQuery-free component that quickly fits single and multi-line text to the width (and optionally height) of its container.
https://textfit.strml.net
643 stars 122 forks source link

Does not work in IE8 #5

Closed cjmcclean closed 11 years ago

cjmcclean commented 11 years ago

This plugin is great work and super helpful on the products my company uses. Unfortunately, as of v2-noJQuery the plugin no longer works in IE8. I wasn't able to get the linked example/test page to work in IE8 either.

Hopefully you can get this figured out!

STRML commented 11 years ago

Yeah, that seems totally plausible, IE is a huge mess when it comes to compatibility with modern DOM methods. No new features were added in v2.0, just the exclusion of the jQuery requirement. If you already use jQuery in your project (and you probably do, since you have to support IE8), just use the old version.

I'll see what I can do to get the non-jQ version running in old IE but I can't guarantee anything. I may end up just adding a disclaimer to the README.

STRML commented 11 years ago

Closing this - I've made a note in a1ee3e7 explaining the need to use the jQuery version for IE <= 8. IE8 and below don't support getComputedStyle and instead use the inferior currentStyle, which needs all sorts of trickery and BS to get working correctly. Since the old jQuery version works fine, I recommend using that instead.

cjmcclean commented 11 years ago

Hey, thanks for the quick turn around. I did as you suggested and fell back to a jQuery backed version since we had to include IE8 support for the time being in our product.

Thanks for the awesome tool!