[Javascript] Hilfe bei einem Menü

Dreamworker1

Cadet 1st Year
Dabei seit
Dez. 2003
Beiträge
10
Hilfe bei einem Menü

hallo,

ich habe ein menü erstellt welches bei einem klick auf den Buchstaben w herausfährt. klickt man nochmal auf den Buchstaben fährt das menü wieder rein.

Alles ist soweit gut doch mein Prob ist das ich das menü rein bzw rausfahren lassen will wenn ich in einem anderen frame einen button betätige. kann mir da jemand helfen ???

hier mal der Quellcode des Menüs
Code:
<html>
<head>
<STYLE><!--BODY {
scrollbar-DarkShadow-Color:#ffffff; 
scrollbar-Track-Color:#ffffff; 
scrollbar-Face-Color:#C0C0C0; 
scrollbar-Shadow-Color:#ffffff; 
scrollbar-Highlight-Color:white; 
scrollbar-3dLight-Color:#ffffff; 
scrollbar-Arrow-Color:#ffffff } 
--></STYLE>  
<style type="text/css">
#divMenu0 {position:absolute; top:0px; left:30px; visibility:hidden;}
#divMenu0 a:link {color:#FF0000;}
#divMenu0 a:hover {color:#ffffff00;background-color:#00FF00;}
#Link1_1 a:link {color:#ff0000;}
#Link1_1 a:visited {color:#ffff00;}
#Link1_1 a:aktiv {color:#000000;background-color:#00FF00;}
#Link1_1 a:hover {color:#ffffff00;background-color:#00FF00;}
#Link1_3 a:link {color:#000000;}
#Link1_3 a:visited {color:#000000;}
#Link1_3 a:aktiv {color:#000000;background-color:#00FFDF;}
#Link1_3 a:hover {color:#000000;background-color:#00FFBF;}


</style>
<script language="JavaScript" type="text/javascript">

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

var tMove=10;

var tSpeed=40

var tMoveOnScroll=false

//How much of the menu should be visible in the in state?
var tShow=20

function makeMenu(obj,nest,show,move,speed){
    nest=(!nest) ? "":'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;		
	this.x=this.css.left||this.css.pixelLeft||this.el.offsetLeft||0
	this.y=this.css.top||this.css.pixelTop||this.el.offsetTop||0
	this.state=1; this.go=0; this.mup=b_mup; this.show=show; this.mdown=b_mdown; 
	this.height=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.moveIt=b_moveIt; this.move=move; this.speed=speed
    this.obj = obj + "Object"; 	eval(this.obj + "=this")	
}

var px = bw.ns4||window.opera?"":"px";

function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px;}
//Menu in
function b_mup(){
	if(this.y>-this.height+this.show){
		this.go=1; this.moveIt(this.x,this.y-this.move)
		setTimeout(this.obj+".mup()",this.speed)
	}else{this.go=0; this.state=1}	
}
//Menu out
function b_mdown(){
	if(this.y<eval(scrolled)){
		this.go=1; this.moveIt(this.x,this.y+this.move)
		setTimeout(this.obj+".mdown()",this.speed)
	}else{this.go=0; this.state=0}	
}

function moveTopMenu(num){
	if(!oMenu[num].go){
		if(!oMenu[num].state)oMenu[num].mup()	
		else oMenu[num].mdown()
	}
	for(i=0;i<oMenu.length;i++){
		if(i!=num && !oMenu[i].state){ oMenu[i].mup()}
	}
}

function checkScrolled(){
	for(i=0;i<oMenu.length;i++){
		if(!oMenu[i].go){
			y=!oMenu[i].state?eval(scrolled):eval(scrolled)-oMenu[i].height+oMenu[i].show
			oMenu[i].moveIt(oMenu[i].x,y)
		}
	}
	if(bw.ns4||bw.ns6) setTimeout('checkScrolled()',40)
}

function topMenuInit(){
	oMenu=new Array()
	oMenu[0]=new makeMenu('divMenu0',"",tShow,tMove,tSpeed) 
	
	scrolled=bw.ns4||bw.ns6?"window.pageYOffset":"document.body.scrollTop"
	
	for(i=0;i<oMenu.length;i++){
		oMenu[i].moveIt(oMenu[i].x,-oMenu[i].height+oMenu[i].show)
		oMenu[i].css.visibility='visible'
	}
	if(tMoveOnScroll) bw.ns4||bw.ns6?checkScrolled():window.onscroll=checkScrolled;
}

//Initing menu on pageload
onload=topMenuInit;

</script>
<script language="JavaScript" src="over.js" type="text/javascript"></script>
</head>

<body marginleft="0" marginheight="0" >

<p align="left">&nbsp;</p>
<div id="divMenu0">
<table width="781" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="169"> 
      <table width="169" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td colspan="2"><img src="lefttop.jpg" width="169" height="37"></td>
        </tr>
        <tr> 
          <td width="44"><img src="move01.jpg" width="44" height="26"></td>
          <td> <a href="index.html" onMouseOut="msout('home',pix1.src);" onMouseOver=" msover('home',pix2.src);"><img name="home" border="0" src="home01.jpg" width="125" height="26" alt="Home"></a></td>
        </tr>
        <tr> 
          <td><img src="move02.jpg" width="44" height="23"></td>
          <td><a href="#" onMouseOut="msout('graphics',pix3.src);" onMouseOver="msover('graphics',pix4.src);"><img name="graphics" border="0" src="graphics01.jpg" width="125" height="23" alt="Graphics"></a></td>
        </tr>
        <tr> 
          <td><img src="move03.jpg" width="44" height="24"></td>
          <td><a href="#" onMouseOut="msout('music', pix5.src);" onMouseOver="msover('music',pix6.src);"><img name="music" border="0" src="music01.jpg" width="125" height="24" alt="Music"></a></td>
        </tr>
        <tr> 
          <td><img src="move04.jpg" width="44" height="24"></td>
          <td><a href="#" onMouseOut="msout('stuff', pix7.src);" onMouseOver="msover('stuff',pix8.src);"><img name="stuff" border="0" src="stuff01.jpg" width="125" height="24" alt="Stuff"></a></td>
        </tr>
        <tr> 
          <td><img src="move05.jpg" width="44" height="24"></td>
          <td><a href="#" onMouseOut="msout('guest', pix9.src);" onMouseOver="msover('guest',pix10.src);"><img name="guest" border="0" src="guests01.jpg" width="125" height="24" alt="Guestbook"></a></td>
        </tr>
        <tr> 
          <td><img src="move06.jpg" width="44" height="24"></td>
          <td><a href="#" onMouseOut="msout('links', pix11.src);" onMouseOver="msover('links',pix12.src);"><img name="links" border="0" src="links01.jpg" width="125" height="24" alt="Links"></a></td>
        </tr>
        <tr> 
          <td><img src="move07.jpg" width="44" height="25"></td>
          <td><a href="#" onMouseOut="msout('contact', pix13.src);" onMouseOver="msover('contact',pix14.src);"><img name="contact" border="0" src="contact01.jpg" width="125" height="25" alt="Contact"></a></td>
        </tr>
        <tr> 
          <td><img src="move08.jpg" width="44" height="23"></td>
          <td><a href="#" onMouseOut="msout('sitemap', pix15.src);" onMouseOver="msover('sitemap',pix16.src);"><img name="sitemap" border="0" src="sitemap01.jpg" width="125" height="23" alt="Sitemap"></a></td>
        </tr>
        <tr> 
          <td><img src="move09.jpg" width="44" height="24"></td>
          <td><img src="blank.jpg" width="125" height="24" alt="Blank-Button" border="0"></td>
        </tr>
        <tr> 
          <td colspan="2"><img src="leftend.jpg" width="169" height="56"></td>
        </tr>
        </table>
	<a href="#" onclick="moveTopMenu(0); return false">w</a>
</div>

</body>
</html>
 

value

Commander
Dabei seit
Dez. 2003
Beiträge
2.086
Re: Hilfe bei einem Menü

Das Script in das andere Frame legen, oder überseh ich irgendwas ?
 

migl

Lt. Junior Grade
Dabei seit
März 2003
Beiträge
310
ja, hast du. er will es per button aus einem anderen Frame machen.
gehts so:
HTML:
<input type="submit" onmousedown="parent.FRAMENAME.moveTopMenu(0); return false">
wobei FRAMENAME der Name des Menuframes ist
 
Top