Epics@GSI Webhome

Toggle Visibility



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.


Click for change of visibility


      * Set SOURCE = %ATTACHURL%/hideshow.js

<script type="text/javascript" src="%SOURCE%"></script>

<a href="Javascript:toggleVisibility('source','block');">Click for change of visibility</a>

<div id="source" style="display: none; padding: 20px; background-color:red">">
originally found at and extended <br />


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

-- PeterZumbruch - 28 Jun 2007
Topic attachments
I Attachment Action Size DateSorted ascending Who Comment
hideshow.jsjs hideshow.js manage 1.8 K 2007-06-28 - 16:54 PeterZumbruch JavaScript hide and show extended and reduced to necessary
Edit | Attach | Print version |  PDF | History: r4 < r3 < r2 < r1 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r2 - 2007-06-29, 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)