-
Notifications
You must be signed in to change notification settings - Fork 14
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
Multi line Condition error on click #8
Comments
Hi @sohilpx, thanks for checking out this spec and EQCSS and for your question! You're totally right that every click affects the layout in this demo, and I think it's based on the way we're guessing the number of 'lines' here. The logic in the plugin is an estimate based on a number of measurements: https://github.com/eqcss/eqcss/blob/gh-pages/EQCSS.js#L979&L998 element_height =
parseInt(computed_style.getPropertyValue('height'))
- parseInt(computed_style.getPropertyValue('border-top-width'))
- parseInt(computed_style.getPropertyValue('border-bottom-width'))
- parseInt(computed_style.getPropertyValue('padding-top'))
- parseInt(computed_style.getPropertyValue('padding-bottom'));
element_line_height = computed_style.getPropertyValue('line-height');
if (element_line_height === 'normal') {
var element_font_size = parseInt(computed_style.getPropertyValue('font-size'));
element_line_height = element_font_size * 1.125;
} else {
element_line_height = parseInt(element_line_height);
} The I'd recommend using a height-based query, here I've reworked the demo and given a Alternatively, I've done something similar to what you're doing here (multi-line text truncation) with EQCSS through a slightly different approach: https://codepen.io/tomhodgins/pen/KgKggX In my HTML I've put the text to display inside a <p data-truncate="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."></p> @element [data-truncate] {
$this:before {
content: 'eval("getAttribute('data-truncate').substring(0,scrollWidth/3)")…';
}
} I hope this helps point you in the right direction! Let me know if there's anything else I can do to help :D |
Hello,
I have used eqcss for the product display. Here is the fiddle https://jsfiddle.net/sohilpx/6af77wcm/ .
It renders fine initially but when i click anywhere the height of the div increases automatically. This is not the expected behavior.
Can you look into this?
The text was updated successfully, but these errors were encountered: