How to remove text expansion arrow if you don’t need to

Asked

Viewed 49 times

0

I want to remove the arrows (pointing down) posts that have no need for expansion (since there is not much text to be shown) and leave this arrow in the posts that has much more text, so that when it is clicked reveal.

EX: The first post only has one line, so I want to remove the arrow from it! the second post has many other lines to be shown so I want this post to continue with the arrow!

Remove an element I know, just do not know how I will know if the amount of text has exceeded the limit being shown.

I had done a post before that, and the idea was to check the height of the father and the son (who is with the text) if the son is bigger than the father then shows arrow if not remove. But the problem is that my div son has fixed size and I can not change the structure, it means that the son will never exceed the div father, it means that this method does not work!
Someone knows one more way? inserir a descrição da imagem aqui

  • 3

    For you to achieve greater success in the answer, try to post the code you have already done, then people will see the best way to help you.

  • The span method should work, even if the child element is fixed, the span with the text would not be.

  • make a calculation of the number of characters needed not to display the arrows, so you can use javascript or jquery to analyze if the amount is greater than x it displays the arrows

  • It is better to count the number of lines then put the button if it is less than 4 then do not put! how can I count the lines?? count using n because as much as I don’t use n the line breaks when it arrives at the end and continues down so count lines of a div using error n! someone knows how to do that?

  • paste your codes to analyze and help you better

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.