Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-21-2004, 09:16 AM   #1
Cyrandir
Registered User
 
Join Date: Jul 2004
Posts: 1
Default DHTML menu

Ok, so i'm not so good with things, and I would like this to be FireFox\Netscape compatible. Can anyone help me make it so? Thank you anyone who can.

Code:
<style type="text/css">
<!--

#master		{position:absolute; width: 200px; top: 10px; left: -120px; z-index:2; visibility:visible;}
#menu		{position:absolute; width: 18px; top: 0px; left: 120px; z-index:5; visibility:visible;}
#top		{position:absolute; width: 120px; top: 0px; left: 0px; z-index:5; visibility:visible;}
#screen		{position:absolute; width: 120px; top: 6px; left: 0px; z-index:5; visibility:visible;}
#screenlinks	{position:absolute; width: 120px; top: 6px; left: 0px; z-index:5; visibility:visible;}

-->
</style>
<style type="text/css">
<!--

.NavJump {font-family: arial; font-size: 16; color: #FFFFFF; text-decoration: none;}
a:link.NavJump {color : #0000FF;}
a:visited.NavJump {color : #0000FF;}
a:active.NavJump {color: #FFFFFF;}
a:hover.NavJump {color: #FFFFFF;}

-->
</style>
<script language = "javascript">
<!--

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ie){
document.write('<style type="text/css">')
document.write("#screen	{filter:Alpha(Opacity=30);}")
document.write("</style>")
}

if(ns){
document.write('<style type="text/css">')
document.write("#master	{clip:rect(0,150,250,0);}")
document.write("</style>")
}


//-->
</script>
<script language = "javascript">
<!--


var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0


var master = new Object("element")
master.curLeft = -120;	master.curTop = 10;
master.gapLeft = 0;		master.gapTop = 0;
master.timer = null;

function moveAlong(layerName, paceLeft, paceTop, fromLeft, fromTop){
clearTimeout(eval(layerName).timer)

if(eval(layerName).curLeft != fromLeft){
     if((Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft)) < paceLeft){eval(layerName).curLeft = fromLeft}
else if(eval(layerName).curLeft < fromLeft){eval(layerName).curLeft = eval(layerName).curLeft + paceLeft}
else if(eval(layerName).curLeft > fromLeft){eval(layerName).curLeft = eval(layerName).curLeft - paceLeft}
if(ie){document.all[layerName].style.left = eval(layerName).curLeft}
if(ns){document[layerName].left = eval(layerName).curLeft}
}

if(eval(layerName).curTop != fromTop){
     if((Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop)) < paceTop){eval(layerName).curTop = fromTop}
else if(eval(layerName).curTop < fromTop){eval(layerName).curTop = eval(layerName).curTop + paceTop}
else if(eval(layerName).curTop > fromTop){eval(layerName).curTop = eval(layerName).curTop - paceTop}
if(ie){document.all[layerName].style.top = eval(layerName).curTop}
if(ns){document[layerName].top = eval(layerName).curTop}
}


eval(layerName).timer=setTimeout('moveAlong("'+layerName+'",'+paceLeft+','+paceTop+','+fromLeft+','+fromTop+')',30)
}

function setPace(layerName, fromLeft, fromTop, motionSpeed){
eval(layerName).gapLeft = (Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft))/motionSpeed
eval(layerName).gapTop = (Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop))/motionSpeed

moveAlong(layerName, eval(layerName).gapLeft, eval(layerName).gapTop, fromLeft, fromTop)
}

var expandState = 0

function expand(){
if(expandState == 0){setPace("master", 0, 10, 10); if(ie){document.menutop.src = "menub.gif"}; expandState = 1;}
else{setPace("master", -120, 10, 10); if(ie){document.menutop.src = "menu.gif"}; expandState = 0;}
}

//-->
</script>


<div id="master">

<div id="menu">
<table border="0" width="18" cellspacing="0" cellpadding="0">
<tr><td width="100%"><a href="javascript:expand()" onfocus="this.blur()"><img name="menutop" border="0" src="menu.gif" width="18" height="70"></a></td></tr>
</table>
</div>

<div id="top">
<table border="0" width="120" cellspacing="0" cellpadding="0">
<tr><td width="100%"><img border="0" src="top.gif" width="120" height="6"></td></tr>
</table>
</div>

<div id="screen">
<table border="0" width="120" cellspacing="0" cellpadding="5">
<tr><td width="100%" bgcolor="#FF0000">

<table border="0" width="100%" bgcolor="#FF0000" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<table border="0" width="100%" cellspacing="1" cellpadding="5">
<tr><td width="100%" bgcolor="#FFFFFF">

<font class="NavJump"><br></font><font class="NavJump"><br></font><font class="NavJump"><br></font>

</td></tr>
</table>

</td></tr>
</table>

</td></tr>
</table>

</td></tr>
</table>

</td></tr>
</table>


</div>

<div id="screenlinks">
<table border="0" width="120" cellspacing="0" cellpadding="5">
<tr><td width="100%">

<table border="0" width="100%" bgcolor="#FF0000" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<table border="0" width="100%" cellspacing="1" cellpadding="5">
<tr>
  <td width="100%" bgcolor="#000000">

<U><B>Tech Links</B></U><br>
<a href="http://www.slashdot.org" class="NavJump" target="_blank"><b>SlashDot</b></a><br>
<a href="http://www.osnews.com" class="NavJump" target="_blank"><b>OSNews</b></a><br>
<a href="http://www.flexbeta.net" class="NavJump" target="_blank"><b>Flexbeta</b></a><br>
<a href="http://www.tcmagazine.net/.net" class="NavJump" target="_blank"><b>TechConnect</b></a><br>
<a href="http://www.geeknewz.com" class="NavJump" target="_blank"><b>GeekNewz</b></a><br>

</td></tr>
</table>


<script language = "javascript">
<!--


if(ie){var sidemenu = document.all.master;}
if(ns){var sidemenu = document.master;}

function FixY(){
if(ie){sidemenu.style.top = document.body.scrollTop+163}
if(ns){sidemenu.top = window.pageYOffset+10}
}


setInterval("FixY()",100);

//-->
</script>

Last edited by Cyrandir; 07-21-2004 at 06:56 PM..
Cyrandir is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.