V
vlad.levin
I'd like to write a control that allows a user to expand a div which
originally shows the first line or two of text. I don't know very much
javascript so I was hoping someone here could point me in the right
direction. Here is the kind of functionality I am looking for:
Let's say people have posted notes to a Web page. The notes are
displayed from newest to oldest:
3:00 PM: If you are editing this file, make sure to... ^
1:00 PM: If you've run into the following performance... ^
The user can click on the ^ symbol to expand the div to show the
remaining text. Now, I've been able to accomplish most of this with
some simple Javascript, but there are a couple of things I don't know
how to do:
1) If all of the text fits into what is currently visible, then don't
even bother showing the ^ symbol.
2) If the text does not fit into what is currently visible, add '...'
to the end of the visible line. When the user expands the text, the
ellipses go away.
PS: If this would work with current versions of Firefox and IE, I'd be
happy, but if it only works with IE, that's fine for now.
originally shows the first line or two of text. I don't know very much
javascript so I was hoping someone here could point me in the right
direction. Here is the kind of functionality I am looking for:
Let's say people have posted notes to a Web page. The notes are
displayed from newest to oldest:
3:00 PM: If you are editing this file, make sure to... ^
1:00 PM: If you've run into the following performance... ^
The user can click on the ^ symbol to expand the div to show the
remaining text. Now, I've been able to accomplish most of this with
some simple Javascript, but there are a couple of things I don't know
how to do:
1) If all of the text fits into what is currently visible, then don't
even bother showing the ^ symbol.
2) If the text does not fit into what is currently visible, add '...'
to the end of the visible line. When the user expands the text, the
ellipses go away.
PS: If this would work with current versions of Firefox and IE, I'd be
happy, but if it only works with IE, that's fine for now.