WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Kleines Javascript Problem (http://www.wcm.at/forum/showthread.php?t=96408)

Lauda Air 09.05.2003 17:51

Kleines Javascript Problem
 
Servus!
Habe mal wieder ein kleines Problem...

Und zwar, siehe mitgeschickte Datei:
Wenn ich in Frame 2 einen Link anklicke, soll sich Frame 2 und 3 ändern.
Ich habe diesen Code verwendet:

function ZweiFrames(URL1,F1,URL2,F2)
{
parent.frames[F1].location.href=URL1;
parent.frames[F2].location.href=URL2;
}


und für die links dieses hier:

<a href="javascript:ZweiFrames('ubutton1.htm','1','cl ients.htm','2')" id="textlink1" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink1', '2')"
onmouseout="css_change ('black', 'textlink1', '2')">


Wenn ich jetzt einen Link öffne, öffnet sich "ubotton1.htm" in Frame 3 und Frame 2 bleibt, wie sie ist.

käptn 09.05.2003 18:16

Versuch mal:

javscript:void(ZweiFrames(...));

~

Lauda Air 09.05.2003 18:31

Zitat:

Original geschrieben von käptn
Versuch mal:

javscript:void(ZweiFrames(...));

~

Geht auch nicht

käptn 09.05.2003 18:58

und

<a href="javascript:void(0);" onclick="...

?

~

Lauda Air 09.05.2003 19:37

Muss ich dann die Funktion "ZweiFrames" ebenfalls in "Void" ändern?

Weil beim Link ruft er ja der Funktion "ZweiFrames" auf.

sagi 09.05.2003 20:28

1) es koennte hilfreich sein, wenn du mehr code postest.

2) hast dir schon Geadnken ueber eine serverseitige Implementierung gemacht? Dann wuerde es nicht nur in allen Browsern funktioniern, sondern es wuerde auch funktineren ;)

3) wenn du gewisse >einschlaegige Seiten< abgrast wird dir auffallen, dass ALLE ein Beispiel dieser Art auf Lager haben. evtl findest du dort eine Loesung fuer dein Problem

4) Ich bin keine Suchmaschine, aber falls du keine kennst: http://www.wisenut.com

mfg

c.

Lauda Air 09.05.2003 20:38


<html>
<head>
<title>Unternehmen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JAVASCRIPT">
var b=0;
var version=navigator.appVersion;
if (navigator.appName=='Microsoft Internet Explorer' && parseInt (version)>=4)
{
b=1;
}
if (navigator.appName=='Netscape' && parseInt (version)>=5)
{
b=1;
}
function css_change(farbe,id,groesse)
{
if (b==1)
{
document.getElementById (id).style.color=farbe;
document.getElementById(id).style.fontSize=groesse ;
}
}
function ZweiFrames(URL1,F1,URL2,F2)
{
parent.frames[F1].location.href=URL1;
parent.frames[F2].location.href=URL2;
}
</SCRIPT>
</head>

<body text="#000000" link="#000000" vlink="#000000" alink="#99CC00" leftmargin="40">


</p>
<table width="60%" border="0">
<tr>
<td height="30"><a href="clients.htm" target="Hauptframe" id="textlink1" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink1', '2')"
onmouseout="css_change ('black', 'textlink1', '2')"> <font size="2" face="Arial Narrow">OUR CLIENTS
</font>
</a></td>
</tr>
<tr>
<td height="30"><a href="people.htm" target="Hauptframe" id="textlink2" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink2', '2')"
onmouseout="css_change ('black', 'textlink2', '2')"> <font size="2" face="Arial Narrow">OUR PEOPLE
</font>
</a></td>
</tr>
<tr>
<td height="30"><a href="pastpresent.htm" target="Hauptframe" id="textlink3" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink3', '2')"
onmouseout="css_change ('black', 'textlink3', '2')"> <font size="2" face="Arial Narrow">OUR PAST/PRESENT
</font>
</a></td>
</tr>
<tr>
<td height="30"><a href="competence.htm" target="Hauptframe" id="textlink4" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink4', '2')"
onmouseout="css_change ('black', 'textlink4', '2')"> <font size="2" face="Arial Narrow">OUR COMPETENCE
</font>
</a>
</font></td>
</tr>
<tr>
<td height="30"><a href="future.htm" target="Hauptframe" id="textlink5" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink5', '2')"
onmouseout="css_change ('black', 'textlink5', '2')"> <font size="2" face="Arial Narrow">OUR FUTURE
</font>
</a>[/b]</font></td>
</tr>
<tr>
<td height="30"><a href="construction.htm" target="Hauptframe" id="textlink6" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink6', '2')"
onmouseout="css_change ('black', 'textlink6', '2')"> <font size="2" face="Arial Narrow">EIN TAG MIT DORFMEISTER
</font>
</a>[/b]</font></td>
</tr>
<tr>
<td height="30"><a href="standorte.htm" target="Hauptframe" id="textlink7" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink7', '2')"
onmouseout="css_change ('black', 'textlink7', '2')"> <font size="2" face="Arial Narrow">STANDORTE
</font>
</a></td>
</tr>
<tr>
<td height="30"><a href="geschichte.htm" target="Hauptframe" id="textlink8" style="text-decoration: none" onmouseover="css_change ('#99CC00', 'textlink8', '2')"
onmouseout="css_change ('black', 'textlink8', '2')"> <font size="2" face="Arial Narrow">GESCHICHTE
</font>
</a>[/b]</font></td>
</tr>
</table>
</body>
</html>
[/b]

Und die derzeitigen Links sollen ausgetausch werden.

sagi 10.05.2003 00:12

thx.

Das Frameset waer auch noch interessant.

c.

Flink 10.05.2003 11:28

versuch doch mal
parent.frames[F1].location.href=URL1;
parent.frames[F2].location.href=URL2;

fix zu codieren:

parent.frames[0].location.href='clients.htm';

usw.
Dann siehst du, was klappt.


Alle Zeitangaben in WEZ +2. Es ist jetzt 23:20 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag