View Full Version : Switch Content Script at end of paragraph.

Orlando Dude
04-18-2007, 06:03 PM
1) Script Title: Switch Content Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

3) Describe problem: Looking to see if it is possible to put the 'expander' at the end of a paragraph, like this...

Deck chairs can be relaxing but erecting them can be troublesome [more...]
to reveal
Deck chairs can be relaxing but erecting them can be troublesome [less...]
Many comedy sketches have been used over the years to highlight the pitfalls etc. ...

With [more...] & [less...] being the activators.

Many thanks


05-16-2007, 05:04 PM
This is a great script, and I've got everything working fine, except that I am also, just like you, trying to do move the expander image to the end of the paragraph, but have not succeeded.
Did you find a solution?
(Additionally I would also like to only use the open expander, but omit the image for closed.)

Best regards,

Orlando Dude
05-17-2007, 08:58 AM

Yes I did (no help from here yet!)

I fiddled around a bit and found that if I did this -
<div>Some text here and then
<a id="text1-title" class="handcursor"></a></div>
<div><p id="text1" class="vsgroup">extra text here</p>

and change the line - vstext.setStatus('[less...] ', '[more...] ')

it gives me -

Some text here and then [more...]

which expands to

Some text here and then [less...]
extra text here

You can change the colours - e.g. vstext.setColor('999999', '505050')

I still can't get it to work in the same line. Always starts a new paragraph but its good enough for now.

Can't show it working as the site is still in production.

Hope this helps.


05-17-2007, 09:17 AM
That uses two seperate divs. That won't allow them to be on the same line.
Not too much you can do about that, without recoding a lot.

05-17-2007, 12:36 PM
Hi Orlando,
Great, I will try this out at once!