You may want the ability to "open up" new material on a page. This would allow you to present an uncluttered page, but with extra material available as the user wants. Consider for example what happens when you click on "More" below.
To do this you first need a Javascript call: <p><strong> <button onclick="var eXTXT=document.getElementById('Extra'); eXTXT.style.display='block'; return false;">More...</button> <button onclick="var eXTXT=document.getElementById('Extra'); eXTXT.style.display='none';return false;">Less...</button> </strong></p> <div id="Extra" style="display:none"> You can reverse the effect - that is have the material showing when the page is loaded, yet allow the user to subsequently hide it. In fact this section is an example of that. If you click on "Hide" below this part of the page will be hidden. To do this use a similar Javascript call (note that you will have to use a different name than 'Extra'). Then in your named DIV make the default display on:
<div id="Extra1" style="display:block">Your extra material here.Notice the DIV name is Extra1, different than the earlier name. </div>
You can also nest open/close sections. Try this below, where you will find a second open/close section within the first.
More Fun... In this example a table is shown when a button is clicked. Notice that the original button disappears and a Close Table button appears. Clicking on that button resets the screen to its original appearance.
Here is the code that does this: Another Example This example opens up a small section to explain a concept. In Mobius the pop-open section is in a Definition box. Give an answer, not a calculator one. The code : <p>Give an <button onclick="var eXTXT=document.getElementById('ExtraF'); eXTXT.style.display='block'; return false;">exact</button> answer, not a calculator one.</p> <div id="ExtraF" style="display:none"> <p>An exact answer uses (if possible) symbols, not decimal expansions. For example <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>π</mi></mrow></math> is exact, 3.141593... is not exact no matter how many decimals you use. Other examples where a calculator answer is not exact are <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mstyle displaystyle="true"> <mfrac> <mrow><mn>3</mn></mrow><mrow> <mn>7</mn>
</mrow></mfrac></mrow></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msqrt><mrow><mn>2</mn></mrow></msqrt></mrow></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msup><mrow><mi mathvariant="italic">e</mi></mrow><mrow><mn>2</mn></mrow></msup></mrow></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow data-cke-white-space-first="1" data-cke-white-space-last="1"> <mi>sin</mi> <mfenced close=")" data-cke-white-space-last="1" open="("> <mrow> <mfrac> <mrow> <mn>5</mn> <mi mathvariant="italic">π</mi> </mrow> <mrow> <mn>7</mn> </mrow> </mfrac> </mrow> </mfenced></mrow></math>.</p> <p align="right"><button onclick="var eXTXT=document.getElementById('ExtraF'); eXTXT.style.display='none';return Additional ExamplesSpecific examples are found here. |
Enhancements Index | Last updated: 2023/12/19 SMS/DAG |