Hide Scroll Buttons

I am loading HTML formatted text into a dynamic text field. I have created buttons to scroll the text up and down. The buttons work great but, I want to hide the buttons if there is not enough text to scroll. I have tried to use text.maxscroll and text.bottomscroll to no avail. Any tutorials or suggestions would be very helpful.