Web Hosting Talk







View Full Version : need script code to display text in this way...


hello20109876
05-04-2006, 01:06 AM
I need script code to display text in this way:

A title (such as Show more text)

by default, short discription is displayed under the title.

when user clicks the title, long discription appears and short disappears.
If user clicks the title again, discription becomes short again (default).

do you have code or sample for this?

thx

Chadha
05-04-2006, 05:49 AM
Have you tried using javascript for this purpose. You can change the style of the element to below

document.getElementById(text1).style.display == ''

to make it visible and to below

document.getElementById(text1).style.display == 'none'

to make it hidden.

Where "text1" is the ID of the element of your choice on the webpage.

hello20109876
05-04-2006, 10:23 AM
My kownledge of javascript is almost zero.
I can not find samples of this kind by google.
I need real code - could u offer it or sample links?

Chadha
05-05-2006, 01:29 AM
Alright, I'll post the code later today since I'm busy right now and can't write an example for you at present.