2Danke
ERLEDIGT
JA
JA
ANTWORTEN
3
3
ZUGRIFFE
330
330
EMPFEHLEN
-
Hey zusammen !

Ich hab' einen Tooltip Script, der das title Attribut ausliest
und als <div> darstellt.. dieser <div> soll eigentlich direkt am
Mauszeiger angezeigt werden..
Firefox und Chrome kriegen das hin.. hab's grad mit
dem IE getestet.. und es hat natürlich nicht funktioniert :-/
Fehlermeldung war:
SCRIPT5007: Für die Eigenschaft "clientX" kann kein Wert abgerufen werden: Das Objekt ist Null oder undefiniert
Und der Script sieht wie folgt aus:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
var qTipTag = "div,img"; var qTipX = 0; var qTipY = 15; tooltip = { name : "qTip", offsetX : qTipX, offsetY : qTipY, tip : null } tooltip.init = function () { var tipNameSpaceURI = "http://www.w3.org/1999/xhtml"; if(!tipContainerID){ var tipContainerID = "qTip";} var tipContainer = document.getElementById(tipContainerID); if(!tipContainer) { tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div"); tipContainer.setAttribute("id", tipContainerID); document.getElementsByTagName("body").item(0).appendChild(tipContainer); } if (!document.getElementById) return; this.tip = document.getElementById (this.name); if (this.tip) { document.onmousemove = function (event) { tooltip.move (event) } ; } var a, sTitle, elements; var a2, sTitle2, elements2; var elementList = qTipTag.split(","); for(var j = 0; j < elementList.length; j++) { elements = document.getElementsByTagName(elementList[j]); if(elements) { for (var i = 0; i < elements.length; i ++) { a = elements[i]; sTitle = a.getAttribute("title"); if(sTitle) { a.setAttribute("tiptitle", sTitle); a.removeAttribute("title"); a.removeAttribute("alt"); a.onmouseover = function() { tooltip.show(this.getAttribute('tiptitle'))}; a.onmouseout = function() { tooltip.hide() } ; } } } } } tooltip.move = function (happening) { var x=0, y=0; if (document.all) {//IE x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft; y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop; x += document.happening.clientX; y += document.happening.clientY; } else {//Good Browsers x = happening.pageX; y = happening.pageY; } x=x-19; tooltip.tip.style.left = (x + this.offsetX) + "px"; tooltip.tip.style.top = (y + this.offsetY) + "px"; } tooltip.show = function (text) { if (!tooltip.tip) return; tooltip.tip.innerHTML = text; tooltip.tip.style.display = "block"; } tooltip.hide = function () { if (!tooltip.tip) return; tooltip.tip.innerHTML = ""; tooltip.tip.style.display = "none"; } function myTipActive () { tooltip.init () ; }
Hoffe sehr jemand hat 'ne Idee, was falsch ist
Beste Grüße
-
Wo hast du denn den move-Code her? was soll document.happening sein? Ersetz das durch window.event
-
Mhh.. ich dachte ich würde das event übergeben
und als Parameter "happening" auslesen und weiterverwenden..
Im Firefox usw funktioniert das ja auch.
Aber window.event klappt einwandfrei!
Ich danke vielmals für deine Hilfe!
Das war sehr sehr sehr hilfreich !!
-
Ähnliche Themen
-
Meine webseite gegen mich :o(
Von firstplaya im Forum Flash PlattformAntworten: 18Letzter Beitrag: 16.03.07, 00:13 -
Will Amerika nicht gegen mich spielen....
Von Tobias K. im Forum SmalltalkAntworten: 12Letzter Beitrag: 21.12.04, 00:03 -
Wie arbeitet man mit PHP 4
Von A-lux im Forum PHPAntworten: 1Letzter Beitrag: 13.11.04, 17:42 -
Beurteilt mich...macht mich fertig... *g*
Von Yasemin im Forum PhotoshopAntworten: 15Letzter Beitrag: 04.01.02, 17:40





Zitieren


Login





