/ Forside / Teknologi / Udvikling / HTML / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
HTML
#NavnPoint
molokyle 11184
Klaudi 5506
bentjuul 3377
severino 2040
smorch 1950
strarup 1525
natmaden 1396
scootergr.. 1320
e.c 1150
10  miritdk 1110
layer problem
Fra : LudwigMoser


Dato : 10-10-03 17:34

hello!

i need to place two layers
one over the other and then move them horizontal

i tried with <div>but only works under each other
my functions won't work with <layer>

could someone show me a slution for this??
please!

thats what i use by now:

<div id="LeftLayer" style="position: relative; left: 0px; top: 0px; z-index:
0; visibility: visible; overflow: visible;" left="0" top="0"><img
src="./res/left.gif" width="401" height="600"></div>

other layer is similar

function to move looks like that:

document.all['LeftLayer'].style.posLeft =
document.all['LeftLayer'].style.posLeft - stepsize;
works fine but not for <layer>

THANKS IN ADVANCE

Ludwig Moser



 
 
Ryan Kristensen (12-10-2003)
Kommentar
Fra : Ryan Kristensen


Dato : 12-10-03 01:22

> i need to place two layers
> one over the other and then move them horizontal
.....
> <div id="LeftLayer" style="position: relative; left: 0px; top: 0px; z-index:
> 0; visibility: visible; overflow: visible;" left="0" top="0"><img
> src="./res/left.gif" width="401" height="600"></div>

Try using position:absolute instead:

> document.all['LeftLayer'].style.posLeft =
> document.all['LeftLayer'].style.posLeft - stepsize;
> works fine but not for <layer>

Use document.getElementById instead - or if you want your HP to work in ie4 as well try this:

function getElement(id) {
if (document.getElementById) return document.getElementById(id);
if (document.all) return document.all[id];}

var elem=getElement('LeftLayer');
elem.style.posLeft = elem.style.posLeft - stepsize;

--
Ryan



Søg
Reklame
Statistik
Spørgsmål : 177505
Tips : 31968
Nyheder : 719565
Indlæg : 6408554
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste