mikey: javascript-funktion im iframe aufrufen

Beitrag lesen

Ihr habt recht! Hier der Code 1:1
Sry für das durch-ein-ander, aber ich dachte es wäre klar was ich meine.

nav.html (geladem im iframe)

<html>
<head>
<meta http-equiv=Content-Language content=de-DE />
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1" />

<meta http-equiv=Content-Style-Type content="text/css; charset=ISO-8859-1" />
<meta http-equiv=Content-Script-Type content="text/javascript; charset=ISO-8859-1" />
<title></title>

<style>
body{background-color:#fff;text-align:center;margin:0;padding:0;}
a img{border:none;}
</style>

<script>
function zoom (navitem) {
 var step=3,stop=32,osize=48;
 var e=document.getElementsByName("navitem");
 var diff,size;
 for(var n=e.length-1;n!=-1;--n){

diff=n-navitem;

if(diff<0)

diff*=-1;

size=osize-(diff*step);
  if(size<stop)

size=stop;
  e[n].width=size;
  e[n].height=size;
  e[n].vspace=diff;
 }

}
function test (){alert(":-)");}
</script>

</head>
<body>
<a target=_parent href="javascript:history.back();" onmouseover="zoom(0);"><img name="navitem" width="48px" height="48px" src="../img/icon/back.ico" alt="vorherige Seite" /></a><a
target=_parent href="../../../test1.html" onmouseover="zoom(1);"><img name="navitem" width="48px" height="48px" src="../img/icon/blank.ico" alt="top" /></a><a
target=_parent href="../../../test2.html" onmouseover="zoom(2);"><img name="navitem" width="48px" height="48px" src="../img/icon/blank.ico" alt="GNU/Linux" /></a>
</body>
</html>

die eigentliche seite

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Eingebettete Frames definieren</title>
</head>
<body>

<h1>TEST1</h1>

<iframe src="./html/nav/html/index.html" width="100%" height="48px" id="nav" name="nav">
  <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen.<a href="../../../index.htm">SELFHTML</a></p>
</iframe>
<script>document.frames.nav.test();</script>
</body>
</html>