So, I have a <div>
element, which has word wrap, but overflow-y
has been set to hidden
(which is what I need).
But let's say that the <div>
is so full of text, that it overflows and in result - the rest of the text is hidden (which is fine).
But I want to achieve the following effect: when and only when the box is overflowing in y direction, I want it to display some text, saying: "Click to display the rest". I know how to make the "Click to display the rest" part, but what I don't know is how to display the text only when the box is overflowing in y direction.
Quick sidenote: I read Calling JavaScript from function from CSS. I had the idea that on overflow-y it would call a function, but that proved to be impossible. So I am looking for another solution.
My <div>
element:
<div style="background-color:rgb(220,220,220);height:30%;width:1024px;overflow-y:hidden;word-wrap:break-word;">
So, the overview of the problem: I need to display "Click here do see the rest" when the div is overflowing in y direction.
Thank you in advance