![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Ma come dico nell'oggetto funziona con IE ma non con firefox, qualcuno mi sa spiegare cosa ho sbagliato? [CUT] if (document.layers) ok, vuoi la compatibilità netscape4 else if (document.all) Ok, vuoi la compatibilità con tutti gli IE>=4 /SCRIPT ? dove sono i browser Gecko? |
#3
| |||
| |||
|
|
Parti da qua: http://www.criosoftware.it/default14.aspx grazie |
#4
| |||
| |||
|
|
In data Mon, 19 Dec 2005 18:41:09 +0100, Demo ha scritto: ? dove sono i browser Gecko? eccoli, ma anche così funziona con IE ma non con firefox: |
|
Parti da qua: http://www.criosoftware.it/default14.aspx ho visto ma non so in che modo possa aiutarmi a risolvere il mio quesito! |
#5
| |||||
| |||||
|
|
eccoli, ma anche così funziona con IE ma non con firefox: SCRIPT LANGUAGE="JavaScript" script type="text/javascript" language="javascript" else if (document.all) io invertirei: prima document.getElementById, poi document.all (che |
|
else if (document.getElementById && (navigator.userAgent.toLowerCase.indexOf("gecko")= =-1)) Perché questa specifica dello userAgent? Firefox non passa "gecko"? (mai |
|
document.getElementById('LivPrinc1').width=780; .style.width document.getElementById('LivPrinc1').style.left=(w indow.innerWidth/2)-(document.getElementById('LivPrinc1').width/2); come sopra |
|
document.getElementById('LivPrinc1').height=570; come sopra document.getElementById('LivPrinc1').style.top=(wi ndow.innerHeight/2)-(document.getElementById('LivPrinc1').height/2); come sopra. |
|
ho visto ma non so in che modo possa aiutarmi a risolvere il mio quesito! Beh, perché come avevi scritto non vi era nulla per firefox, per forza non |
#6
| |||
| |||
|
|
io invertirei: prima document.getElementById, poi document.all (che servirà solo per IE4). Inoltre se usi la mia function |
|
puoi fare tutto in un'unica botta (prendi il riferimento con GetRef(), esci se GetRef()==null e usi GetRef per tutto senza questi if. |
#7
| |||
| |||
|
|
In data Mon, 19 Dec 2005 18:41:09 +0100, Demo ha scritto: ? dove sono i browser Gecko? eccoli, ma anche così funziona con IE ma non con firefox: |
#8
| |||
| |||
|
|
Senti, se non ti interessa centrare il tutto su browser vetusti come Netscape 4.x, potresti usare semplicemente i CSS e buona notte ai suonatori: style type="text/css" #box{ width:780px; height:570px; background-color:#e0e0ee; position:absolute; left:50%; top:50%; margin-left:-390px; margin-top:-285px; } /style div id="box">this is my box</div |
#9
| |||
| |||
|
|
style type="text/css" #box{ width:780px; height:570px; background-color:#e0e0ee; position:absolute; left:50%; top:50%; margin-left:-390px; margin-top:-285px; } /style |
#10
| |||
| |||
|
|
ZER0 <zer0.shock (AT) libero (DOT) it> ha scritto: style type="text/css" #box{ width:780px; height:570px; background-color:#e0e0ee; position:absolute; left:50%; top:50%; margin-left:-390px; margin-top:-285px; } /style Premessa: ho provato. |
![]() |
| Thread Tools | |
| Display Modes | |
| |