source: t29-www/en/inc/special.old/special.js @ 1

Last change on this file since 1 was 1, checked in by sven, 16 years ago

This reposity is supposed to contain the whole content of
http://www.technikum29.de. You can read about the progress
of the SVN migration in our wiki at http://dev.technikum29.de/

The first import only contains the /en subdirectory, to test
the SVN directory autoversioning and post-commit-auto-update
features in an area where heribert, the main user, usually
doesn't write or - when he writes - never writes something
important (only width/height things of images, etc.).

Please note: In later use/when this reposity finally gets
used on every day life, the commit comments won't be in
english any more.

--Sven, on his balcony computer at 24. July 2008.

File size: 2.1 KB
Line 
1/*
2 TOGGLEINFO
3
4 Blendet content_name ein/aus und gibt
5 dafür alternativen inhalt alternate_name
6 an
7
8 möglicher switch in datei: special_toggleinfo_on
9 standardeinstellung hier: standard
10*/
11
12if (window.addEventListener) window.addEventListener("load",specialbox_init,false);
13else if (window.attachEvent) window.attachEvent("onload",specialbox_init);
14
15var standard = 1; // Standartstatus: 1 = inhalt anzeigen, 0 = inhalt verbergen
16
17var box_name = 'specialBox'; // Name der ID der togglebox
18var alternate_name = 'specialAlternate'; // Name der ID des alternativen text (wenn inhalt nicht angezeigt werden soll)
19var content_name = 'specialContent'; /// Name der ID des inhalts (muss in einer <div> stecken)
20var toggle_name = 'specialToggle'; // Name der ID des toggle-links (<a>)
21
22var state = 1; // Status: 1 = inhalt angezeigt, 0 = inhalt verborgen
23
24function specialbox_init()
25{
26    // loading der seite
27    // in datei benutzbarer switch => wenn gesetzt, togglezeugs einblenden
28    give = (typeof(special_toggleinfo_on) != "undefined") ? 0 : 1;
29
30    // checken, ob es ein toggle-teil in seite gibt
31    if(document.getElementById(box_name))
32       specialbox_toogle(give);
33}
34
35function specialbox_toogle(action)
36{
37    if(typeof(action) != 'undefined') // if(action) geht nicht, da wenn action=0...
38        state = action; // action: eigene aktionsangabe
39
40    oBox = document.getElementById(box_name);
41    oAlternate = document.getElementById(alternate_name);
42    oContent = document.getElementById(content_name);
43    oToggle = document.getElementById(toggle_name);
44
45    if(state == 1)
46    {
47        // inhalt verbergen, alternate anzeigen, linktext auf "anzeigen"
48        oContent.style.display = 'none';
49        oAlternate.style.display = 'block';
50        oToggle.firstChild.nodeValue = 'anzeigen';
51        state = 0;
52    }
53    else
54    {
55         // alternate verbergen, inhalt anzeigen, linktext auf "verbergen"
56         oContent.style.display = 'block';
57         oAlternate.style.display = 'none';
58         oToggle.firstChild.nodeValue = 'verbergen';
59         state = 1;
60    }
61}
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License