How can i sandwitch in and out a text paragraph between some articles

Solenthaler
Solenthaler used Ask the Experts™
on
With ModX (1.0.2) i want to realize an elegant way of an -> read more mechanism.
It should work as follows: If one presses the >read more< tag, then the additional (read more) text is inserted (sandwiched in) after the tag, and the rest of the form is pushed down / if you push again on the tag, the additional (sandwiched in) text closes and the remaining text of the document pushes up again. Any solution HTML, CSS or PHP or ModX Plugin is apreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You could use a div with javascript, Hide and show type thing...
Carlos LlanosIT Manager

Commented:
Yes maeltar's solution is right on...here's how you do it...

HTML:
 
<p>Original Paragraph information here</p>
<div class="readmore" style="display:none">
<p>Hidden Content</p>
</div>
<br />
<hr />
<br />
<p>Next Paragraph here</p>

Open in new window


CSS:
 
.readmore {
display:block;
}

Open in new window

Author

Commented:
Dear experts, i see the idea and it's a step toward the solution. How would the java script look like:
read more >>
First Click -> expand / Second Click  -> collaps
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Carlos LlanosIT Manager

Commented:
That's exactly it...I'll get the code for you...
IT Manager
Commented:
Actually I think it's best if I just gave you the page to the code...

http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/

This way you can see all sorts of different uses for the div displays.

Author

Commented:
It's exactly what i wanted. Thanks a lot

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial