Wednesday03
Threadersteller
Dabei seit: 31.07.2007
Ort: -
Alter: -
Geschlecht: -
|
Verfasst Di 31.07.2007 08:53
Titel Cascade Menu - Problem |
|
|
hi leute,
hab da ein problem mit einem cascade menu...formatieren lässt es sich recht gut und es funktioniert ja eigentlich auch,da gibts nur etwas das mir noch nicht so gefällt: auch wenn i im 2. hauptlink auf einen unterlink drücke, baut sich das menü wieder von vorne (ab dem 1. link) auf und das möchte ich nicht. also wenn ich im 2. hauptlink einen unterlink drücke, sollte der zweite block der unterlinks offen bleiben. kann mir da jemand helfn? ich hoffe ihr versteht meine frage. anbei mein script:
<tr>
<style type="text/css">
<!--
.menu
{
background-color: #5b7a99;
border: 1px solid #008;
font-family: Verdana;
position: absolute;
font-weight: bold;
padding-top: 3px;
font-size: 12px;
cursor: pointer;
width: 198px;
color: #fff;
}
.item_panel
{
border-left: 1px solid #008;
border-right: 1px solid #008;
clip: rect(0, 150, 0, 0);
position: absolute;
width: 198px;
}
.item_panel a
{
text-decoration: none;
cursor: pointer;
color: #000;
width: 198px;
}
.item
{
background-color: #e9f0f8;
font-family: Verdana;
font-size: 10px;
width: 198px;
}
//-->
</style>
<script type="text/javascript">
<!--
// www: http://www.javarea.de
// Copyright by javarea.de
// Link[nr] = 'position [0 is menu/1 is item] | Link name | url | target (blank|top|frame_name)'
var Link = new Array();
Link[0] = '0|Das Zentrum |http://kks.i-med.ac.at/index2.php?param=zentrum&lang=de';
Link[1] = '1|Lage|http://kks.i-med.ac.at/index2.php?param=zentrum&lang=de|';
Link[2] = '1|Geschichte|http://kks.i-med.ac.at/index2.php?param=geschichte&lang=de|';
Link[3] = '1|Ziele|http://kks.i-med.ac.at/index2.php?param=ziele&lang=de|';
Link[4] = '0|Organisation|http://kks.i-med.ac.at/index2.php?param=organisation&lang=de| ';
Link[5] = '1|Leitung|http://kks.i-med.ac.at/index2.php?param=leitung&lang=de|';
Link[6] = '1|Organigramm|http://kks.i-med.ac.at/index2.php?param=organigramm&lang=de|';
Link[7] = '1|Mitarbeiter|http://kks.i-med.ac.at/index2.php?param=mitarbeiter&lang=de|';
Link[8] = '1|Partner|http://kks.i-med.ac.at/index2.php?param=partner&lang=de|';
Link[9] = '1|Stellenangebote|http://kks.i-med.ac.at/index2.php?param=stellen&lang=de|';
Link[10] = '0|Leistungsangebot | http://kks.i-med.ac.at/index2.php?param=leistung&lang=de|';
Link[11] = '1|Angebot|http://kks.i-med.ac.at/index2.php?param=leistung&lang=de|';
Link[12] = '0|Klinische Studien';
Link[11] = '1|Leistungsangebot | http://kks.i-med.ac.at/index2.php?param=leistungen&lang=de|';
Link[12] = '0|Klinische Studien';
Link[13] = '1|Leistungsdiagramm | http://kks.i-med.ac.at/index2.php?param=diagramm&lang=de|';
Link[14] = '1|allgemeine Infos | http://kks.i-med.ac.at/index2.php?param=diagramm&lang=de|';
Link[15] = '0|Patienteninformation';
Link[16] = '1|Infos | http://kks.i-med.ac.at/index2.php?param=patinfo&lang=de|';
Link[17] = '0|Aus- & Weiterbildung';
Link[18] = '1|Aus- & Weiterbildung| http://kks.i-med.ac.at/index2.php?param=patinfo&lang=de|';
Link[19] = '0|Veranstaltungen';
Link[20] = '1|Veranstaltungen | http://kks.i-med.ac.at/index2.php?param=patinfo&lang=de|';
Link[21] = '0|Patri Modul';
Link[22] = '1|Patri Modul | http://kks.i-med.ac.at/index2.php?param=patinfo&lang=de|';
Link[23] = '0|Pressemitteilungen';
Link[24] = '1|Pressemitteilungen | http://kks.i-med.ac.at/index2.php?param=patinfo&lang=de|';
Link[25] = '0|Links & Literatur';
Link[26] = '1|verschiedene Links | http://kks.i-med.ac.at/index2.php?param=links&lang=de|';
Link[27] = '0|';
var height = 20; // Hoehe der Menuekoepfe
var iheight = 15; // Hoehe der Menueelemente
var bgc = '#e9f0f8' // background color of the item
var over_bgc = '#fff';
var tc = '#000' // text color of the item
var over_tc = '#004891';
var speed = 0;
var timerID = 0;
var width = 200;
var N = (document.all) ? 0 : 1;
var self_menu = new Array();
function write_menu()
{
smc = 0;
mn = 0;
mni = 1;
start = -1;
document.write('<div style="position: absolute;">');
for (var i = 0; i < Link.length; i++)
{
la = Link[i].split('|');
if (la[0] == 0)
{
if (start == 0)
{
document.write('</div>');
h = csmc * iheight;
tmn = mn; // - h;
self_menu[smc] = new Array(tmn, h, 0, -2);
smc++;
mn--;
}
csmc = 0;
document.write('<div id="down' + smc + '" class="menu" '
+ 'style="top: ' + mn + 'px; height: ' + height + 'px;" '
+ 'onclick="pull_down(' + smc + ', ' + mni + ');">'
+ ' ' + la[1] + '</div>');
self_menu[smc] = new Array(mn, height, 0, mni);
smc++;
mni++;
mn += height;
start = 1;
}
else
{
if (start == 1)
{
if (N)
mn += 2;
document.write('<div id="down' + smc + '" class="item_panel" '
+ 'style="top: '+ mn + 'px;">');
start = 0;
}
document.write('<a href="' + la[2] + '"'
+ ((la[3] != '') ? ' target="' + la[3] + '"' : '')
+ '><div id="d' + i + '" class="item" '
+ 'style="height: ' + iheight + 'px;'
+ ((N) ? ' width:150px;' : '')
+ '" onmouseover="color(this.id);" '
+ 'onmouseout="uncolor(this.id);">'
+ ' ' + la[1] + '</div></a>');
csmc++;
}
}
if (start == 0)
{
document.write('</div>');
h = csmc * iheight;
tmn = mn + 5; // - h;
self_menu[smc] = new Array(tmn, h, 0);
name = 'down' + (self_menu.length - 1);
obj = document.getElementById(name);
obj.style.borderBottomColor = '#008';
obj.style.borderBottomWidth = '1px';
obj.style.borderBottomStyle = 'solid';
}
document.write('</div>');
}
function color(obj)
{
document.getElementById(obj).style.backgroundColor = over_bgc;
document.getElementById(obj).style.color = over_tc;
}
function uncolor(obj)
{
document.getElementById(obj).style.backgroundColor = bgc;
document.getElementById(obj).style.color = tc;
}
function pull_down(nr, c)
{
if (timerID == '')
{
to = self_menu[nr + 1][1]
begin = nr + 2;
if (timerID != '')
clearTimeout(timerID);
if (self_menu[nr + 1][2] == 0)
{
self_menu[nr + 1][2] = 1;
if (nr == (self_menu.length - 2))
to++;
epull_down(begin, to, 0);
}
else
{
to = 0;
self_menu[nr + 1][2] = 0;
name = 'down' + (nr + 2);
open_item = 0;
for (var i = 0; i < nr; i++)
if (self_menu[i][2] == 1)
open_item += self_menu[i][1];
if (N == false)
open_item -= (c * 1);
if (nr == (self_menu.length - 2))
{
val = self_menu[self_menu.length - 1][1];
to = -1;
}
else
val = parseInt(document.getElementById(name).style.top) - (open_item) - (c * height);
epull_up(begin, to, val);
}
}
}
function epull_down(nr, to, nowv)
{
name = 'down' + (nr - 1);
obj = document.getElementById(name).style.clip = 'rect(0, ' + width + ', ' + (nowv + 1) + ', 0)';
for (var i = nr; i < self_menu.length; i++)
{
name = 'down' + i;
obj = document.getElementById(name);
obj.style.top = parseInt(obj.style.top) + 1;
}
nowv++;
if (nowv < to)
timerID = setTimeout('epull_down(' + nr + ', ' + to + ', ' + nowv + ');', speed);
else
timerID = 0;
}
function epull_up(nr, to, nowv)
{
name = 'down' + (nr - 1);
obj = document.getElementById(name).style.clip = 'rect(0, ' + width + ', ' + nowv + ', 0)';
for (var i = nr; i < self_menu.length; i++)
{
name = 'down' + i;
obj = document.getElementById(name);
obj.style.top = parseInt(obj.style.top) - 1;
}
nowv--;
if(nowv > to)
timerID = setTimeout('epull_up(' + nr + ', ' + to + ', ' + nowv + ');', speed);
else
timerID = 0;
}
function startup(nr)
{
write_menu();
if (nr != 0)
{
for (var i = 0; i < self_menu.length; i++)
{
if (self_menu[i][3] == nr)
pull_down(i, nr);
i == self_menu.length;
}
}
}
//-->
</script>
</head>
<body>
<script type="text/javascript">
<!--
startup(1);
//-->
</script> </tr>
|
|