anders wrote in dk.edb.internet.webdesign.html:
> Jeg har de nedenståend Javascript, der er en menu, der falder ned fra top
> mod bund. Jeg vil meget gerne ændre dette, så den kommer ind fra venstre mod
> højre, men hvordan gøres dette? Og kan det gøres?
>
> Anders
>
> <SCRIPT LANGUAGE="JavaScript">
> function buildMenu() {
> speed=25;
> topdistance=100;
> items=5;
> y=-50;
> ob=1;
> if (navigator.appName == "Netscape") {
> v=".top=",dS="document.",sD="";
> }
> else {
> v=".pixelTop=",dS="",sD=".style";
> }
> }
> function scrollItems() {
> if (ob<items+1) {
> objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y);
> if (y<topdistance) setTimeout("scrollItems()",speed);
> else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed);
> }
> }
> </SCRIPT>
> </head>
> <BODY onLoad="buildMenu(), scrollItems();">
> <div id="object1" style="position:absolute; visibility:show; left:25px;
> top:-50px; z-index:2">
> <table border=0 width=150 bgcolor=80FFFF>
> <td><center>
> <a href=
http://yoursite.com/page1.html>English
> </center></td>
> </table>
> </div>
> <div id="object2" style="position:absolute; visibility:show; left:25px;
> top:-50px; z-index:2">
> <table border=0 width=150 bgcolor=80FFFF>
> <td><center>
> <a href=
http://yoursite.com/page2.html>Vaikelud
> </center></td>
> </table>
> </div>
> <div id="object3" style="position:absolute; visibility:show; left:25px;
> top:-50px; z-index:2">
> <table border=0 width=150 bgcolor=80FFFF>
> <td><center>
> <a href=
http://yoursite.com/page3.html>Muud
> </center></td>
> </table>
> </div>
>
>
> <div id="object4" style="position:absolute; visibility:show; left:25px;
> top:-50px; z-index:2">
> <table border=0 width=150 bgcolor=80FFFF>
> <td><center>
> <a href=
http://yoursite.com/page4.html>Maastikud
> </center></td>
> </table>
> </div>
>
>
> <div id="object5" style="position:absolute; visibility:show; left:25px;
> top:-50px; z-index:1">
> <table border=0 width=150 bgcolor=80FFFF>
> <td><center>
> <a href=mailto:salmik@hot.ee target="main">Saada email</a>
> </center></td>
> </table>
> </div>
>
> </body>
> </html>
>
>
ok hvis du ændre koden til dette virker det i IE 5.5, jeg ved ikke med
netscape. det der er sket er at .pixelTop er skiftet ud med .left,
topdistance+=40 er fjernet derud over er vært lags top ændret.
<SCRIPT LANGUAGE="JavaScript">
function buildMenu() {
speed=25;
topdistance=100;
items=5;
y=-50;
ob=1;
if (navigator.appName == "Netscape") {
v=".left=",dS="document.",sD="";
}
else {
v=".left=",dS="",sD=".style";
}
}
function scrollItems() {
if (ob<items+1) {
objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y);
if (y<topdistance) setTimeout("scrollItems()",speed);
else y=-50, ob+=1, setTimeout("scrollItems()",speed);
}
}
</SCRIPT>
</head>
<BODY onLoad="buildMenu(), scrollItems();">
<div id="object1" style="position:absolute; visibility:show; left:-150px;
top:20px; z-index:2">
<table border=0 width=150 bgcolor=80FFFF>
<td><center>
<a href=
http://yoursite.com/page1.html>English
</center></td>
</table>
</div>
<div id="object2" style="position:absolute; visibility:show; left:-150px;
top:50px; z-index:2">
<table border=0 width=150 bgcolor=80FFFF>
<td><center>
<a href=
http://yoursite.com/page2.html>Vaikelud
</center></td>
</table>
</div>
<div id="object3" style="position:absolute; visibility:show; left:-150px;
top:80px; z-index:2">
<table border=0 width=150 bgcolor=80FFFF>
<td><center>
<a href=
http://yoursite.com/page3.html>Muud
</center></td>
</table>
</div>
<div id="object4" style="position:absolute; visibility:show; left:-150px;
top:110px; z-index:2">
<table border=0 width=150 bgcolor=80FFFF>
<td><center>
<a href=
http://yoursite.com/page4.html>Maastikud
</center></td>
</table>
</div>
<div id="object5" style="position:absolute; visibility:show; left:-150px;
top:140px; z-index:1">
<table border=0 width=150 bgcolor=80FFFF>
<td><center>
<a href=mailto:salmik@hot.ee target="main">Saada email</a>
</center></td>
</table>
</div>
</body>
</html>
--
KONKURRENCE PÅ HTML.dk:
fortæl hvordan din drømmeeditor ser ud
og vind luksus webhoteller fra Wannafind
KLIK HER! =>
http://www.html.dk/editor