I am getting text from an api xml document and outputting it. I need to limit the amount of text that shows up. But I am doing something wrong. I am limiting the height of the div to 200px and and hiding overflow, then by clicking a button I am showing the text. But when I go to hide it again, it does not work.
Here is the jsfiddle: http://jsfiddle.net/liveandream/zXDKK/
If there is anyway someone could also help me have it slide up and down and not cut the line of words in half, it would be GREATLY APPRECIATED! Thanks!
The
.readLessdoesn’t exist when you bind the event. Try below code,See alternate solution below for better code.
DEMO
Alternatively, you can bind it to
#readwhich will be much better.. see below,DEMO