-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic width #7
Comments
Same happens on resize (both ways). I also tested something like: $('.class').truncate();
$( window ).resize(function() {
$('.class').truncate();
}); but it:
*The lag is also present in the begining, when the page loads. It loads without truncating and then updates the DOM. I'm testing it in an AngularJS app, so maybe I'm doing something wrong too |
I have experienced the lag too. It was in a situation where I was trying to truncate over 100 texts. The lag is definitely caused by the hidden span tag (worker), which is used to properly calculate the actual width being taken up by the text. Unfortunately, I don't think there's any other way around this in order to get the actual width the text takes up inside of an element... Unless multi threading exists in JavaScript, lol! |
I like this plugin, but the main issue I have is that I'm not able to use this on dynamic divs.
For example, when you want to use this for a mobile website and the user rotates the screen you gain more space, but this plugin is not able to be dynamic.
The text was updated successfully, but these errors were encountered: