views:

134

answers:

3

Is it possible to create a text sprite and selectively display parts of the same HTML file and ignore the rest. The part to be displayed is selected by a menu generated generated using CSS with links within the same page.

(The length of each section is unknown and expected to vary greatly).

Communicating with the server is unfortunately not an option.

And as you might expect i am new to CSS,PHP and JS

A: 

Sounds like CSS property visibility set to hidden | visible | collapse.

vartec
Thanks vartec//closed ?????
qwrty
+1  A: 

you will want to wrap each section with an ID tag, and control the visibility with javascript. There are several methods of controlling visibility in JavaScript.

The CSS elements that control visibility are visibility and display.

Visibility shows or hides text using the attributes in the above reply, and display allows you to actually remove that block from the DOM by using "block" and "none" as the attributes. You'll want to choose whichever element works best for your application.

Javascript libraries such as Prototype/script.aculo.us or J-Query, MooTools, etc are fantastic for this kind of control.

If you want to learn this kind of scripting from scratch, the book "DOM Scripting" by Jeremy Keith is a fantastic book that can be completed in a couple of days.

cloudhead
A: 

You should use display none to hide things and display block to show them again (or display inline)

George Sisco