滑动选单(恳请帮忙…感谢)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>橫拉式選單</TITLE>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META http-equiv=Content-Language content=zh-tw>
<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
<STYLE>A {
COLOR: navy; TEXT-DECORATION: none
}
A:hover {
COLOR: red
}
UNKNOWN {
COLOR: #808080
}
DIV {
FONT-WEIGHT: bold; FONT-SIZE: 12pt; FONT-FAMILY: 細明體
}
</STYLE>
<script>
ie=document.all?1:0;
n=document.layers?1:0;
lshow=100;
var move=10;
menuSpeed=40;
var moveOnScroll=true;
var tim;
var ltop;
//Object constructor
function makeMenu(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.';
this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style');
this.state=1;
this.go=0;
this.width=n?this.css.document.width:eval(obj+'.offsetWidth');
this.left=b_getleft;
this.obj = obj + "Object"; eval(this.obj + "=this");
}
//Get's the top position.
function b_getleft(){
var gleft=(n) ? eval(this.css.left):eval(this.css.pixelLeft);
return gleft;
}
function moveMenu(div_name){
oMenu=new makeMenu(div_name);
scrolled=n?"window.pageYOffset":"document.body.scrollTop";
oMenu.css.left=-oMenu.width+lshow;
ltop=(n)?oMenu.css.top:oMenu.css.pixelTop;
oMenu.css.visibility='visible';
if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
if(!oMenu.state){
clearTimeout(tim);
mIn();
}else{
clearTimeout(tim);
mOut();
}
}
//Menu in
function mIn(){
if(oMenu.left()>-oMenu.width+lshow){
oMenu.go=1;
oMenu.css.left=oMenu.left()-move;
tim=setTimeout("mIn()",menuSpeed);
}else{
oMenu.go=0;
oMenu.state=1;
}
}
//Menu out
function mOut(){
if(oMenu.left()<0){
oMenu.go=1;
oMenu.css.left=oMenu.left()+move;
tim=setTimeout("mOut()",menuSpeed);
}else{
oMenu.go=0;
oMenu.state=0;
}
}
function checkScrolled(){
if(!oMenu.go) oMenu.css.top=eval(scrolled)+ltop;
if(n) setTimeout('checkScrolled()',30);
}
</script>
</HEAD>
<BODY >
<P align=center><BR></CENTER><FONT color=#000000 size=2>※橫拉式選單展示結果※</FONT>
</P>
<A onclick="moveMenu('divMenu1');" href="javascript://">【1請按一下】</A>
<A onclick="moveMenu('divMenu2');" href="javascript://">【2請按一下】</A>
<DIV id=divMenu1 style="LEFT: 30px; VISIBILITY: hidden; WIDTH: 440px; POSITION: absolute; TOP: 80px; HEIGHT: 50px">
<A href="http://www.powerpc.idv.tw/cgi.htm">【aaaaaaaa】</A>
<A href="http://www.powerpc.idv.tw/asp.htm">【bbbbbbb】</A>
<A href="http://www.powerpc.idv.tw/script.htm">【cccccc】</A>
<A href="http://www.powerpc.idv.tw/applets.htm">【dddddd】</A>
</DIV>
<DIV id=divMenu2 style="LEFT: 30px; VISIBILITY: hidden; WIDTH: 440px; POSITION: absolute; TOP: 80px; HEIGHT: 50px">
<A href="http://www.powerpc.idv.tw/cgi.htm">【111111】</A>
<A href="http://www.powerpc.idv.tw/asp.htm">【222222】</A>
<A href="http://www.powerpc.idv.tw/script.htm">【3333333】</A>
<A href="http://www.powerpc.idv.tw/applets.htm">【33333333】</A>
</DIV>
<br>
</BODY></HTML>
==============================================================================
原本是一个选单,后来改成两个后…在new makeMenu的地方不知要如何下手…
因为选单跑出来后…跑不进去…
一直在new…
麻烦高手帮帮忙,谢谢!