hi,
Wie rufst du die Funktion denn auf?
onMouseOver, und im Firefox & Opera gehts..._Wie_ heisst Code ...
Ok, dann hier mal mein Scriptentwurf (wird vor dem schließenden </body> - Tag eingebunden) :
//------------------------------
document.write('<div style=\"position:absolute; left:0px; top:0px; min-width: 200px; height:50px; background-image:url(http://derwahnsinn.de.funpic.de/bilder/trbox.png); display:none; color:#ffffff; border: 1px solid #009900\" id=\"infodiv\">info</div>');
function hingehen(e) {
x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;
breite = (document.body.clientWidth) ? document.body.clientWidth : window.innerWidth;
if ((breite / 2) < x) {
x = x - 200;
}
if (document.getElementById("infodiv") != null) {
document.getElementById("infodiv").style.left = (x) + "px";
document.getElementById("infodiv").style.top = (y + 20) + "px";
}
}
function dasein(e) {
document.getElementById('infodiv').style.display = 'block';
if (this.tip != null) {
if (this.title.length <= 15) {
tittell = this.tip;
} else {
tittell = this.tip.substr(0,13) + '...';
}
addro = this.href;
} else {
//tittell = this.tip;
//addro = this.href;
z = 0;
while (document.getElementsByTagName('a')[z] != this && document.getElementsByTagName('a')[z] != null) {
z++;
}
if (document.getElementsByTagName('a')[z] != null) {
tittell = document.getElementsByTagName('a')[z].tip;
addro = document.getElementsByTagName('a')[z].href;
} else {
tittell = 'Scheiss IE';
addro = 'Hol dir Opera oder Firefox';
}
}
if (addro.length <= 30) {
addr = addro;
} else {
addr = addro.substr(0,30) + '...';
}
if (this == null) {
addr = 'alles im a****';
}
document.getElementById('infodiv').innerHTML = '<font size="5">' + tittell + '</font><br />' + addr;
}
function weggehen(e) {
document.getElementById('infodiv').style.display = 'none';
}
function addEvent(obj, eventTyp, func, bul) {
if (obj.addEventListener) {
obj.addEventListener(eventTyp, func, bul);
return true;
} else if (obj.attachEvent) {
var katze = obj.attachEvent("on"+eventTyp, func);
return katze;
} else {
return false;
}
}
i = 0;
var titel = new Array();
while (document.getElementsByTagName('a')[i] != null) {
obje = document.getElementsByTagName('a')[i];
obje.tip = obje.title;
obje.title = '';
addEvent(obje,'mouseover',dasein,false);
addEvent(obje,'mouseout',weggehen,false);
i ++;
}
addEvent(document,'mousemove',hingehen,false);
//---------------------------
Timon @ http://www.wahnsinn.de.tl
--
Käsebrötchen
Selfcode: sh:( fo:) ch:| rl( br:^ n4:& ie:{ mo:) va:) de:] zu:| fl:| ss:) ls:[ js:|
Käsebrötchen
Selfcode: sh:( fo:) ch:| rl( br:^ n4:& ie:{ mo:) va:) de:] zu:| fl:| ss:) ls:[ js:|