ERLEDIGT
JA
JA
ANTWORTEN
9
9
ZUGRIFFE
739
739
EMPFEHLEN
-
04.02.08 19:52 #1
Hallo!
Gibt es eine Möglichkeit, ein JS-Skript im Stil "<script src="fileadmin/skripte/mootoolsLoginbox.js" type="text/javascript"></script>" für den IE5.5 & IE6.0 auszublenden? Oder irgendwie unnützbar zu machen?
Mit bestem Dank im Voraus,
JosDie Logo-Link-Sammlung: http://www.tutorials.de/tutorials144667.html
[Kamera..........Canon EOS 1DM2N, Canon EOS 5DMII]
-
04.02.08 20:09 #2
- Registriert seit
- Dec 2007
- Ort
- Bremen
- Beiträge
- 3.418
Hi,
da helfen Dir vielleicht conditional comments.
LG
PS.: Hmm, nee, ist Quatsch. Wieso willst Du die denn unnutzbar machen? Das JS sollte eher so programmiert sein, dass es halt nichts macht, wenn der Browser das nicht unterstützt (auch keine Fehlermeldungen schmeissen...)Geändert von kuddeldaddeldu (04.02.08 um 20:16 Uhr)
-
04.02.08 22:44 #3
Also mit einer Funktion umpacken? Nur wie mach ich das? Gibt es hierfür eine Vorlage, oder sowas?
Die Logo-Link-Sammlung: http://www.tutorials.de/tutorials144667.html
[Kamera..........Canon EOS 1DM2N, Canon EOS 5DMII]
-
05.02.08 02:03 #4
- Registriert seit
- Dec 2007
- Ort
- Bremen
- Beiträge
- 3.418
Hi,
nein, das Skript "mootoolsLoginbox.js" (selbst geschrieben?) sollte einfach dementsprechend programmiert sein. mootools soll übrigens kompatibel mit IE6 sein. Wo hakt's denn bei Deinem Skript? Was hast Du Dir denn vorgestellt, wenn ein Klick im IE5.5 eine JS-Funktion anstösst, die Du nach Deiner Taktik gar nicht definiert hast?
LG
-
05.02.08 08:09 #5
Nee, das mottoolsLoginbox Skript funktioniert hervorragend. Ich habe damit von Typo3 die newloginbox mit Ajax erstellt sodass der Cache von Typo3 besser und effizienter arbeiten kann.
Das Problem liegt in der Ext. dom-titletips.js, welche statt der normalen Browser-A-Tag-Title eine DHTML-Box anzeigt. Das Positionieren dieser geht in älteren Browsern nicht, deshalb würde ich es einfach weglassen weil es nicht dringend nötig ist.
Hier das Skript welches nur mit mit neuen Browern ausgeführt werden soll: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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
/****************************************************************************** Files: dom-tooltips.js, dom-tooltips.css Version: 1.4 Author: John Ha Author URI: http://ink.bur.st Description: Add tooltips to any web page without modifying any code, as long as there are already title atributes used in the page. An implementation of tooltips using DOM. The script will search the document for all title attributes and automaticaly assign the title text to a toolip for that element. The element to attach a tooltip to can also be defined when calling this class. ******************************************************************************* Copyright (c) 2005, 2006 John Ha ******************************************************************************* This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/2.5/ ******************************************************************************* If this code has helped you in anyway, any acknowledgement would be appreciated ******************************************************************************* */ tooltip = { name: 'dom-tooltips', offsetX: 15, offsetY: 20, maxWidth: 200, enabled: false, tip: null, ie: document.all, ns6: document.getElementById && !document.all, opr: window.opera, init: function (tags) { if (!document.getElementById) return; typeof tags == 'undefined' ? tags = new Array('a', 'acronym') : 0; // default elements (* for all) with (this) { if (!document.getElementById(name)) { tip = document.createElement ('div'); tip.id = name; // CSS Validator won't see these invalid proprietary rules tip.style.cssText = 'filter:alpha(opacity=85);-moz-opacity:.85;-khtml-opacity:.85;opacity:.85;'; } document.getElementsByTagName('body')[0].appendChild(tip); } for (j = 0; j < tags.length; j++) { var all = document.getElementsByTagName(tags[j]); for (i = 0; i < all.length; i++) { // TextArea resizer and tinyMCE uses title = 'true' for ID purposes, so no need to process their title //if (all[i].nodeName != 'TEXTAREA' && all[i].title != 'true' && all[i].title && typeof(all[i].title) == 'string') { if (!(all[i].nodeName == 'TEXTAREA' && all[i].title == 'true') && all[i].title && typeof(all[i].title) == 'string') { tooltip.addtip(all[i], all[i].title); all[i].alt = all[i].title; all[i].title = ''; pmk_addEvent(all[i], 'mouseout', all[i].mouseoutHandler = function () { tooltip.hide(); }, false); } } } typeof document.mousemoveHandler != 'undefined' ? pmk_removeEvent(document, 'mouseover', document.mousemoveHandler, false) : 0; pmk_addEvent(document, 'mousemove', document.mousemoveHandler = function (evt) { tooltip.move (evt); }, false); }, addtip: function (obj, tiptext) { tiptext = tooltip.format(tiptext); pmk_addEvent(obj, 'mouseover', obj.mouseoverHandler = function () { tooltip.enable(tiptext); }, false); }, changetip: function (obj, tiptext) { typeof obj.mouseoverHandler != 'undefined' ? pmk_removeEvent(obj, 'mouseover', obj.mouseoverHandler, false) : 0; tooltip.addtip(obj, tiptext); }, ietruebody: function () { return document.compatMode && document.compatMode != 'BackCompat' ? document.documentElement : document.body; }, format: function (s) { //s = s.replace(/(.{1,50})(?:[\s\/]|$)/g, '$1<br />'); // Word wrap long lines //s = s.replace(/\'/g, '\\\''); s = s.replace(/\r?\n/g, '<br />'); return s; }, move: function (evt) { with (this) { if (enabled) { var curX = ns6 ? evt.pageX : event.x + tooltip.ietruebody().scrollLeft; var curY = ns6 ? evt.pageY : event.y + tooltip.ietruebody().scrollTop; //tip.innerHTML = 'x:'+curX+', y:'+curY+', w:'+tip.offsetWidth+', h:'+tip.offsetHeight; // Uncomment for debugging //Find out how close the mouse is to the corner of the window var rightedge = ie && ! opr ? tooltip.ietruebody().clientWidth - event.clientX - offsetX : window.innerWidth - evt.clientX - offsetX - 18; var bottomedge = ie && ! opr ? tooltip.ietruebody().clientHeight - event.clientY - offsetY : window.innerHeight - evt.clientY - offsetY; var leftedge = offsetX < 0 ? offsetX * (-1) : -1000; //if the horizontal distance isn't enough to accomodate the width of the tooltip if (rightedge < tip.offsetWidth) { //move the horizontal position of the tooltip to the left by it's width tip.style.left = ie ? tooltip.ietruebody().scrollLeft + event.clientX - tip.offsetWidth - 10 + 'px' : window.pageXOffset + evt.clientX - tip.offsetWidth - 10 + 'px'; } else if (curX < leftedge) { tip.style.left = '5px'; } else { //horizontal position of the tooltip tip.style.left = curX + offsetX + 'px'; } //same concept with the vertical position if (bottomedge < tip.offsetHeight) { tip.style.top = ie ? tooltip.ietruebody().scrollTop + event.clientY - tip.offsetHeight + 'px' : window.pageYOffset + evt.clientY - tip.offsetHeight + 'px'; } else { tip.style.top = curY + offsetY + 'px'; } tip.style.visibility = 'visible'; } } }, enable: function (text) { with (this) { if (!tip) return; if (ns6 || ie) { tip.innerHTML = text; //tip.style.cssText = tip.style.cssText.replace(/width: ?\d+(px;?)?/i, ''); tip.style.width = ''; if (tip.offsetWidth > maxWidth) tip.style.width = maxWidth + 'px'; enabled = true; } } }, hide: function () { with (this) { if (!tip) return; if (ns6 || ie) { tip.style.visibility = 'hidden'; enabled = false; } } } }; function pmk_addEvent(obj, evType, fn, useCapture) { if (obj.addEventListener) { obj.addEventListener(evType, fn, useCapture); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { alert("Handler could not be attached"); } } function pmk_removeEvent(obj, evType, fn, useCapture){ if (obj.removeEventListener){ obj.removeEventListener(evType, fn, useCapture); return true; } else if (obj.detachEvent){ var r = obj.detachEvent("on"+evType, fn); return r; } else { alert("Handler could not be removed"); } } pmk_addEvent(window, 'load', function () { tooltip.init(new Array('*')); }, false);
Zu sehen ist das ganze auf meiner Seite. Derweilen schließe ich den IE6.0 & 5.5 durch TYPO3-PHP-Conditions aus, ist halt a bissi arbeit fürs system.Die Logo-Link-Sammlung: http://www.tutorials.de/tutorials144667.html
[Kamera..........Canon EOS 1DM2N, Canon EOS 5DMII]
-
-
05.02.08 12:14 #7
- Registriert seit
- Dec 2007
- Ort
- Bremen
- Beiträge
- 3.418
Hi,
stimmt, ich hab' gar nicht bedacht, dass man den Kommentar hinter dem if ja auch einfach schließen kann, so dass das von anderen Browsern auch eingebunden wird.
LG
-
05.02.08 12:33 #8Die Logo-Link-Sammlung: http://www.tutorials.de/tutorials144667.html
[Kamera..........Canon EOS 1DM2N, Canon EOS 5DMII]
-
05.02.08 12:39 #9
- Registriert seit
- Dec 2007
- Ort
- Bremen
- Beiträge
- 3.418
Hi,
Nicht, wenn man den HTML-Kommentar hinter dem if wieder schließt. Ich hab' den gleichen Denkfehler gemacht.Ich dachte das alle anderen Browser den Inhalt in diesen Conditions ignorieren?!
LG
-
Eben...das ist der Trick, ein auskommentierter Kommentar
Ähnliche Themen
-
[C#] Kanäle aus Stereo WAV Datei in je eine neue WAV Mono Datei schreiben
Von Webrat im Forum .NET Grafik und SoundAntworten: 2Letzter Beitrag: 12.02.08, 18:21 -
*.swf Datei in eine *.exe Datei einbinden per Visual Basic 6.0
Von cymbalta im Forum Visual Basic 6.0Antworten: 0Letzter Beitrag: 11.07.07, 16:47 -
XML Datei in eine XHTML Datei einbinden
Von danny_b im Forum XML TechnologienAntworten: 1Letzter Beitrag: 11.07.06, 10:36 -
in jar eine neue datei per JarOutputStream hinzufügen
Von mrno im Forum JavaAntworten: 4Letzter Beitrag: 20.09.05, 17:08 -
2 x Php in eine Php datei einbinden?
Von dundee12 im Forum HTML & XHTMLAntworten: 13Letzter Beitrag: 22.07.05, 08:24





Zitieren

Login





