![]() |
|
|
Themen-Optionen |
|
|
Nach oben #1 |
|
Neuer Benutzer
Registriert seit: 16.09.2005
Ort: DD
Beiträge: 2
|
Hallo,
Habe ein JS-Problem. Folgende Ausgangssituation: Code:
function Is() {
// gibt Browsertyp zurück
}
var is = new Is();
function objectSetup() {
if(is.iedom || is.nsdom) {
page = new Object();
page.width = (is.nsdom) ? innerWidth : document.body.clientWidth;
page.height = (is.nsdom) ? innerHeight : document.body.clientHeight;
link = new layerSetup(null,"linkLYR",0,00,200,200,2,"visible");
} else {
// bla, blub
}
}
function getObject(type,parent,id) {
if(type == "layer") {
if(is.ns4) {
if(id != "rootLYR") {
this.obj = (parent == null) ? document["rootLYR"].document[id] : parent.document[id];
this.obj.htm = (parent == null) ? document["rootLYR"].document[id].document : parent.document[id].document;
} else {
this.obj = document[id];
}
} else if(is.iedom && !is.ie6) {
this.obj = document.all[id].style;
this.obj.htm = document.all[id];
} else if(is.iem5 || is.ns6 || is.ie6) {
this.obj = document.getElementById(id).style;
this.obj.htm = document.getElementById(id);
}
} else if(type == "image") {
// Bla /blub...
}
return this.obj;
}
function layerSetup(parent,id,left,top,width,height,zindex,visibility) {
this.obj = new getObject("layer",parent,id);
this.obj.left = left;
this.obj.top = top;
if(width != null) {
if(is.ns4) {
this.obj.clip.right = width;
} else {
this.obj.width = Math.abs(width);
}
}
if(height != null) {
if(is.ns4) {
this.obj.clip.bottom = height;
} else {
this.obj.height = Math.abs(height);
}
}
this.obj.zIndex = zindex;
this.obj.visibility = visibility;
return this.obj;
}
HTML: Code:
<html>
<head>
<script type="text/javascript" language="javascript" src="switch.js"></script>
</head>
<body onload="objectSetup()" onresize="history.go(0)">
<div id="linkLYR">
<!-- BLABLA BLA -->
</div>
</body>
</html>
Code:
link.top: 100; link.visibility: "hidden"; Der IE verhält sich auch so wie er soll, jedoch im Firefox habe ich folgendes Problem: -Einige Objekteigenschaften, wie z.B. background oder visibility werden ordnungsgemäss gesetzt. -Andere Objekteigenschaften, wie z.B. top oder left werden ohne Ausgabe eines Fehlers ignoriert. Mist, gerade die brauche ich!! Kann jemand anhand des geposteten Codes die Ursache dafür herausfinden, oder liegts am Firefox?? mfg
__________________
@stf |
|
|
|
|
|
Nach oben #2 |
|
me pro ok?
Registriert seit: 07.09.2005
Ort: Pulheim bei Köln
Beiträge: 964
|
Wenn du die Attribute vorher noch nicht initialisiert hast:
Code:
var this.attr = value; // anstatt von: this.attr = value;
__________________
Gedanken aus Draht stricken einen Zaun. |
|
|
|
![]() |
| Lesezeichen |
| Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
| Themen-Optionen | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Firefox und Thunderbird mit neuen Security- und Bugfix-Versionen | Ben | Nachrichten | 6 | 07.01.2007 20:29 |
| Java DOM: Default Namespace Problem | Böreck | HTML, XML und CSS | 4 | 18.03.2006 14:32 |
| Firefox und JS | robo47 | Plauderecke | 5 | 13.09.2005 21:18 |
| Problem mit getNodeValue() und setNodeValue() in DOM | Zauberlehrling | HTML, XML und CSS | 1 | 21.08.2005 19:08 |