Warning: Can't find topic Epics.JavaScriptShowHideTogglePeterZumbruch Epics@GSI Webhome

Toggle Visibility

Sources

Description

This JavaScript-function enables you to toggle the visibility of almost any object of HTML code, having an object id defined, changing from invisible to a display style mode, vice versa.
In this example toggled by a click. It is also possible to use any Event mechanissm like onClick, onMouseOver etc.

Example

Click for change of visibility

Code

%INCLUDE{"Epics.JavaScriptShowHideTogglePeterZumbruch"}%

<div onClick="toggleVisibility('source','block');"> __Click for change of visibility__ </div>
<div id="source" style="display: none; padding: 20px; background-color:red">
originally found at and extended <br />
http://www.testbox.de/fileadmin/hideshow.js
</div>

Syntax


toggleVisibility('object id','display style of visible object');
<!-- display style, e.g. 'block', 'inline', 'inline-block', 'list-item', 'run-in' and more -->

-- PeterZumbruch - 02 Jul 2007
Edit | Attach | Print version |  PDF | History: r4 < r3 < r2 < r1 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r3 - 2007-07-02, PeterZumbruch
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)