MyBB.de Forum

Normale Version: punkt ein und ausklappen
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
hallo allerseits,
gibt es einen befehl um ein menü ausklappen bzw. einklappen zulassen?
also:
zuerst"xxx"
dann"xxx
xxxxxxxxxxx"
wenn ja wäre es nett wenn ihr ihn mir sagen würdet.
So wie auf der Startseite?
ja, genau so!
Ich nutze dafür ein Java Script. Bsp. kannst du hier sehen:

http://forum.perfect-purple.com/links.php

Klicke auf die + - Zeichen und teste es. Solltest du interessiert sein, so würde ich das ganze hier einstellen. Verschachtelung etc ist alles möglich.
Das Prinzip ist doch das gleiche. Wink
(01.11.2009, 13:36)Olaf schrieb: [ -> ]...das ganze hier einstellen...

ja das wäre toll!
was ist der code wenn man es noch auf anderen seiten,also nicht im forum zeigen möchte???
Der Code stammt von www.je0.de

Code:
<script type="text/javascript">
function Klappen(Id) {
var KlappText = document.getElementById('Lay'+Id);
var KlappBild = document.getElementById('Pic'+Id);
var jetec_Minus="inhalt/codeschnipsel/minus.gif", jetec_Plus="inhalt/codeschnipsel/plus.gif";
if (KlappText.style.display == 'none') {
KlappText.style.display = 'block';
KlappBild.src = jetec_Minus;
} else {
KlappText.style.display = 'none';
KlappBild.src = jetec_Plus;
}}
</script>
<a href="javascript:Klappen(1)"><img src="inhalt/codeschnipsel/plus.gif" id="Pic1" border=0 alt="aus/ein-klappen"></a>
Auf die Grafik klicken um zu klappen.
<div id="Lay1" style="display: none;"><hr>
Hier der Text den man aus/ein-klappen kann.
<br>Natürlich auch Grafiken oder alles andere.
</div>

Der Code meiner Seite http://forum.perfect-purple.com/links.php
ist etwas länger. Nur daran sieht man gut, wie man das ganze ausbauen kann:

Zur besseren Bsp. Darstellung poste ich das kommplette Link Template von meinen Board:

Code:
<html>
<head>
<title>{$settings['bbname']} - Links</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="tcat" align="center"><strong>Links</strong></td>
</tr>
<tr>
<td class="trow1" align="center" valign="middle">

<script type="text/javascript">
function Klappen(Id) {
var KlappText = document.getElementById('Lay'+Id);
var KlappBild = document.getElementById('Pic'+Id);
var jetec_Minus="images/collapse.gif", jetec_Plus="images/collapse_collapsed.gif";
if (KlappText.style.display == 'none') {
KlappText.style.display = 'block';
KlappBild.src = jetec_Minus;
} else {
KlappText.style.display = 'none';
KlappBild.src = jetec_Plus;
}}
</script>

<a href="javascript:Klappen(200)" style="vertical-align: middle;  align: center; font-weight: normal;">
Info
<img src="images/collapse.gif" id="Pic200" border=0 alt="-" title="+" /></a>
&nbsp;&nbsp;
<a href="javascript:Klappen(201)" style="vertical-align: middle;  align: center; font-weight: normal;">
Deep Purple and Family Links
<img src="images/collapse_collapsed.gif" id="Pic201" border=0 alt="-" title="+" /></a>
&nbsp;&nbsp;
<a href="javascript:Klappen(202)" style="vertical-align: middle;  align: center; font-weight: normal;">
Perfect Purple Links
<img src="images/collapse_collapsed.gif" id="Pic202" border=0 alt="-" title="+" /></a>
&nbsp;&nbsp;
<a href="javascript:Klappen(203)" style="vertical-align: middle;  align: center; font-weight: normal;">
Other Links
<img src="images/collapse_collapsed.gif" id="Pic203" border=0 alt="-" title="+" /></a>
</td>
</tr>
<tr>
<td class="trow1" align="center" valign="middle">

<div id="Lay200" style="display: yes; text-align:center;">
<table style="border:0px; padding-top:5px; padding-buttom:5px; padding-left:0px; padding-right:0px; margin:0px; cellspacing:0px; width: 100%; ">
<tr><td style="text-align:center;"><strong>
Please select the category!</strong><br />
<i>All links are placed in a new window!</i>
<br /><br /><strong>Bitte die Kategorie ausw&auml;hlen!
</strong><br />
<i>Alle Links werden in einen neuen Fenster ge&ouml;ffnet!</i>
<br /><br /></td></tr>
</table>
</div>

<div id="Lay201" style="display: none; text-align:center;">
<table style="width:100%; border:0px; padding:10px; margin:0px; cellspacing:10px;">
<tr><td colspan="2" align="center" width="50%">
<h4>Official Artist</h4>
</dt></tr>
<tr><td align="center">
<a href="http://www.deep-purple.com/" target="_blank">Deep Purple</a>
</td></tr><tr>
<td align="center">
<a href="http://www.donairey.com/" target="_blank">Don Airey</a>
</dt><td align="center">
<a href="http://www.blackmoresnight.com/" target="_blank">Blackmore's Night</a>
</td></tr><tr>
<td align="center">
<a href="http://www.davidcoverdale.com/" target="_blank">David Coverdale</a>
</dt><td align="center">
<a href="http://www.gillan.com/" target="_blank">Ian Gillan</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.glennhughes.com/" target="_blank">Glenn Hughes</a>
</td><td align="center">
<a href="http://www.picturedwithin.com/" target="_blank">Jon Lord</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.satriani.com/" target="_blank">Joe Satriani</a>
</td><td align="center">
<a href="http://www.nicksimper.com/" target="_blank">Nick Simper</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.joelynnturner.com/" target="_blank">Joe Lynn Turner</a>
</td><td align="center">
<a href="http://www.rogerglover.com/" target="_blank">Roger Glover</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.stevemorse.com/" target="_blank">Steve Morse</a>
</td><td align="center">
<a href="http://www.tbolin.com/" target="_blank">Tommy Bolin</a>
</dt></tr>
<tr><td colspan="2" align="center"><hr>
<h4>Fansites</h4>
</dt></tr>
<tr><td align="center">
<a href="http://www.the-aviator.de/" target="_blank">Aviator</a>
</td><td align="center">
<a href="http://www.blackmore-world.com" target="_blank">blackmore-world.com</a>
</dt></tr>
<tr><td align="center">
<a href="http://deeppurplehub.proboards.com/" target="_blank">Deep Purple HUB</a>
</td><td align="center">
<a href="http://www.deepest-purple.de/sbforum/index.php" target="_blank">deepest-purple.de</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.deeppurpleliveindex.com/" target="_blank">Deep Purple Live Index</a>
</td><td align="center">
<a href="http://www.deep-purple.nl/" target="_blank">DP Family Bootleg Artwork</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.purple-bootleg.net/" target="_blank">purple-bootleg.net</a>
</td><td align="center">
<a href="http://www.purple.de/dirk/purple/" target="_blank">purple.de</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.ritchieblackmore.de/" target="_blank">ritchieblackmore.de</a>
</td><td align="center">
<a href="http://www.rainbowfanclan.com/" target="_blank">rainbowfanclan.com</a>
</dt></tr>
<tr><td align="center">
<a href="http://www.thehighwaystar.com/" target="_blank">The Highwaystar</a>
</td><td align="center">
<a href="http://www.klaus-deep-purple-side.de/index/" target="_blank">Wrongman's World</a>
</dt></tr>
<tr><td colspan="2" align="center"><hr>
<h4>Coverbands</h4>
</dt></tr>
<tr><td align="center">
<a href="http://www.blackpurple.de/" target="_blank">Black Purple</a>
</td><td align="center">
<a href="http://www.demonseye.com/" target="_blank">Demon's Eye</a>
</dt></tr>
<tr><td align="center">
<a href="http://cheap-turtle.de/" target="_blank">Cheap Turtle</a>
</td><td align="center">&nbsp;
</dt></tr>
</table>
</div>

<div id="Lay202" style="display: none; text-align:center;">
<table style="width:100%;border:0px; padding-top:5px; padding-buttom:5px; padding-left:20px; padding-right:20px; margin:0px; cellspacing:10px; ">
<tr><td align="right" class="trow1" width="50%">
<!-- <textarea name="lizenz" cols="50" rows="10 scrolling="no" readonly>&lt;a href="http://forum.perfect-purple.com/"&gt;
forum.perfect-purple.com&lt;/a&gt;</textarea> -->
<strong><a href="http://perfect-purple.com/" target="Perfect Purple">Perfect Purple:</a></strong></td>
<td align="left" class="trow1" width="50%">http://perfect-purple.com</td></tr>
<tr><td align="right" class="trow1"><strong><a href="http://forum.perfect-purple.com/">Board:</a></strong></td>
<td align="left" class="trow1">http://forum.perfect-purple.com</td></tr>
<tr><td align="right" class="trow1"><strong><a href="http://perfect-purple.com/gallery/pixlie.php" target="Perfect Purple">Gallery:</a></strong></td>
<td align="left" class="trow1">http://perfect-purple.com/gallery/pixlie.php</td>
</tr>
<tr>
<td align="right" class="trow1"><strong><a href="http://homepage.perfect-purple.com/" target="Perfect Purple">Homepage:</a></strong></td>
<td align="left" class="trow1">http://homepage.perfect-purple.com</td>
</tr>
</table>
<table style="width:100%;border:0px; padding-top:5px; padding-buttom:5px; padding-left:20px; padding-right:20px; margin:0px; cellspacing:10px; ">
<tr><td colspan="3"><br /></td></tr>
<tr>
<td align="center" class="trow1"><strong><a href="http://perfect-purple.com/stat/" target="Perfect Purple Stats">Perfect Purple Stats</a></strong><br />(since 29.09.2008)</td>
<td align="center" class="trow1"><strong><a href="http://forum.perfect-purple.com/stats.php">Board Stats</a></strong><br />(since 23.04.2009)</td>
<td align="center" class="trow1"><strong><a href="http://perfect-purple.com/mybb-history/index.php"  target="Perfect Purple History">Board History</a></strong><br />(since 23.04.2009)</td>
</tr>
<tr><td colspan="3"><br /><h3>Perfect Purple Advertisement</h3>
<strong>HTML Code:</strong><br />
<div class="tcat">&lt;a href="http://perfect-purple.com/"&gt;
perfect-purple.com&lt;/a&gt;</div>
<br /><strong>BB Code:</strong><br /><div class="tcat">[url=http://perfect-purple.com/]perfect-purple.com[/url]</div>
<br />
<hr><br />
<a href="http://perfect-purple.com/"><img src="http://perfect-purple.com/logo400x60.png" border="0" alt="Logo" /></a>
<br /><strong>HTML Code:</strong><br /><div class="tcat">&lt;a href="http://perfect-purple.com/"&gt;&lt;img src="http://perfect-purple.com/logo400x60.png" border="0" alt="Logo" /&gt;&lt;/a&gt;
</div>
<br /><strong>BB Code:</strong><br /><div class="tcat">[url=http://perfect-purple.com/][img]http://perfect-purple.com/logo400x60.png[/img][/url]
</div>
<br />
</td></tr>
</table>
</div>

<div id="Lay203" style="display: none; text-align:center;">
<table style="border:0px; padding-top:5px; padding-buttom:5px; padding-left:0px; padding-right:0px; margin:0px; cellspacing:0px; ">
<tr><td>
<br /><br /></td></tr>
</table>
</div>
</TD>
</TR>
</table>
<br />
</td>
</tr>
</table>
{$footer}
</body>
</html>