Einzelnen Beitrag anzeigen
Alt 26.10.2003, 16:01   #2
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard

Zitat:
Das layers-Objekt wird von Netscape ab Version 6.0 nicht mehr unterstützt. Es sollte also nur noch aus Gründen der Rückwärtskompatibilität zu Netscape 4.x Verwendung finden.
Für heutige Browser müsste es mit einem <div> gehen:
Code:
<style>
menuepunkt{position:absolute; left:0; top:0; visibility:hidden; z-index:200;}</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()

function makeMenuItem(obj){
 this.elm= document.getElementById? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
/* Diese Zeile heißt: "Gibt es document.getElementById? Wenn Ja dann: document.getElementById(obj), sonst: ist bw(in dieser Variable wird der Browser gespeichert) ie4? Ja:document.all[obj] Sonst: bw.ns4? Ja:document.layers[obj] Sonst:0
Danach ist in elm die Id von obj gespeichert. Das bedingung?a:b ist eine Kurzschreibweise für if(bedingung){a}else{b}
*/
 this.css= bw.ns4?this.elm:this.elm.style;
}
item1=new makeMenuItem('Punkt1')
</script>
<div id="Punkt1" class="menuepunkt">Menüpunkt</div>
Probier mal, ob du auf menuepunkt.css.left und menuepunkt.css.top zugreifen kannst. Dann kannst du z.b. folgendes machen:
5 nach rechts
5 nach links

Ich habe Code von dhtmlcentral.com ein bischen modifiziert, daher gehört noch folgendes zwischen <script>und </script>
Code:
/**********************************************************************************   
Dynamic Tooltips 
*   Copyright (C) 2001 Michael van Ouwerkerk
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Michael van Ouwerkerk 
* modified by Jak
*********************************************************************************/
Hoffe es funktioniert (und du kommst damit zu recht).

Jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten