把层放到右边,left=500,图片onmouseover使层往左移,onmouseout使层回到原位置。急用,谢谢大侠!
1<html>
2<head>
3<title>无标题文档</title>
4<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
5<style>
6
7#divMenu {font-family:arial,helvetica; font-size:12pt; font-weight:bold}
8#divMenu a{text-decoration:none;}
9#divMenu a:hover{color:red;}
10</style>
11<script language="JavaScript1.2">
12/********************************************************************************
13Submitted with modifications by Jack Routledge (http://fastway.to/compute) to DynamicDrive.com
14Copyright (C) 1999 Thomas Brattli @ www.bratta.com
15This script is made by and copyrighted to Thomas Brattli
16This may be used freely as long as this msg is intact!
17This script has been featured on http://www.dynamicdrive.com
18********************************************************************************
19Browsercheck:*/
20ie=document.all?1:0
21n=document.layers?1:0
22
23//These are the variables you have to set:
24
25//How much of the layer do you wan't to be visible when it's in the out state?
26lshow=0
27
28//How many pixels should it move every step?
29var move=10;
30
31//At what speed (in milliseconds, lower value is more speed)
32menuSpeed=40
33
34//Do you want it to move with the page if the user scroll the page?
35var moveOnScroll=false
36
37/********************************************************************************
38You should't have to change anything below this.
39********************************************************************************/
40//Defining variables
41var tim;
42var ltop;
43
44//Object constructor
45function makeMenu(obj,nest){
46nest=(!nest) ? '':'document.'+nest+'.'
47this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
48this.state=1
49this.go=0
50this.width=n?this.css.document.width:eval(obj+'.offsetWidth')
51this.left=b_getleft
52this.obj = obj + "Object"; eval(this.obj + "=this")
53}
54//Get's the top position.
55function b_getleft(){
56var gleft=(n) ? eval(this.css.left):eval(this.css.pixelLeft);
57return gleft;
58}
59/********************************************************************************
60Deciding what way to move the menu (this is called onmouseover, onmouseout or onclick)
61********************************************************************************/
62function moveMenu(){
63if(!oMenu.state){
64clearTimeout(tim)
65mIn()
66}else{
67clearTimeout(tim)
68mOut()
69}
70}
71//Menu in
72function mIn(){
73if(oMenu.left()>-oMenu.width+lshow){
74oMenu.go=1
75oMenu.css.left=oMenu.left()-move
76tim=setTimeout("mIn()",menuSpeed)
77}else{
78oMenu.go=0
79oMenu.state=1
80}
81}
82//Menu out
83function mOut(){
84if(oMenu.left()<0){
85oMenu.go=1
86oMenu.css.left=oMenu.left()+move
87tim=setTimeout("mOut()",menuSpeed)
88}else{
89oMenu.go=0
90oMenu.state=0
91}
92}
93/********************************************************************************
94Checking if the page is scrolled, if it is move the menu after 不要的!!!!!!
95********************************************************************************/
96function checkScrolled(){
97if(!oMenu.go) oMenu.css.top=eval(scrolled)+ltop
98if(n) setTimeout('checkScrolled()',30)
99}
100/********************************************************************************
101Inits the page, makes the menu object, moves it to the right place,
102show it
103********************************************************************************/
104function menuInit(){
105oMenu=new makeMenu('divMenu')
106scrolled=n?"window.pageYOffset":"document.body.scrollTop"
107oMenu.css.left=-oMenu.width+lshow
108ltop=(n)?oMenu.css.top:oMenu.css.pixelTop;
109oMenu.css.visibility='visible'
110if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
111}
112
113//Initing menu on pageload
114onload=menuInit;
115</script>
116</head>
117<body bgcolor="#FFFFFF" text="#000000">
118<div id="divMenu" style="position:absolute; top:250; left:30; width:200; visibility:hidden; background-color:F0F0F0">
119<nobr> <a>网络游戏,版权所有</a>
120<a <html="" \---------------------------------------------------------------="" 改好了="">
121<head>
122<title>无标题文档</title>
123<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
124<style>
125
126#divMenu {font-family:arial,helvetica; font-size:12pt; font-weight:bold}
127#divMenu a{text-decoration:none;}
128#divMenu a:hover{color:red;}
129</style>
130<script language="JavaScript1.2">
131/********************************************************************************
132Submitted with modifications by Jack Routledge (http://fastway.to/compute) to DynamicDrive.com
133Copyright (C) 1999 Thomas Brattli @ www.bratta.com
134This script is made by and copyrighted to Thomas Brattli
135This may be used freely as long as this msg is intact!
136This script has been featured on http://www.dynamicdrive.com
137********************************************************************************
138Browsercheck:*/
139ie=document.all?1:0
140n=document.layers?1:0
141
142//These are the variables you have to set:
143
144//How much of the layer do you wan't to be visible when it's in the out state?
145lshow=0
146
147//How many pixels should it move every step?
148var move=10;
149
150//At what speed (in milliseconds, lower value is more speed)
151menuSpeed=40
152
153//Do you want it to move with the page if the user scroll the page?
154var moveOnScroll=false
155
156/********************************************************************************
157You should't have to change anything below this.
158********************************************************************************/
159//Defining variables
160var tim;
161var ltop;
162
163//Object constructor
164function makeMenu(obj,nest){
165nest=(!nest) ? '':'document.'+nest+'.'
166this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
167this.state=1
168this.go=0
169this.width=n?this.css.document.width:eval(obj+'.offsetWidth')
170this.left=b_getleft
171this.obj = obj + "Object"; eval(this.obj + "=this")
172}
173//Get's the top position.
174function b_getleft(){
175var gleft=(n) ? eval(this.css.left):eval(this.css.pixelLeft);
176return gleft;
177}
178/********************************************************************************
179Deciding what way to move the menu (this is called onmouseover, onmouseout or onclick)
180********************************************************************************/
181function moveMenu(flag){
182if(flag){
183clearTimeout(tim)
184mIn()
185}else{
186clearTimeout(tim)
187mOut()
188}
189}
190//Menu in
191function mIn(){
192if(oMenu.left()>-oMenu.width+lshow){
193oMenu.go=1
194oMenu.css.left=oMenu.left()-move
195tim=setTimeout("mIn()",menuSpeed)
196}else{
197oMenu.go=0
198oMenu.state=1
199}
200}
201//Menu out
202function mOut(){
203if(oMenu.left()<0){
204oMenu.go=1
205oMenu.css.left=oMenu.left()+move
206tim=setTimeout("mOut()",menuSpeed)
207}else{
208oMenu.go=0
209oMenu.state=0
210}
211}
212/********************************************************************************
213Checking if the page is scrolled, if it is move the menu after 不要的!!!!!!
214********************************************************************************/
215function checkScrolled(){
216if(!oMenu.go) oMenu.css.top=eval(scrolled)+ltop
217if(n) setTimeout('checkScrolled()',30)
218}
219/********************************************************************************
220Inits the page, makes the menu object, moves it to the right place,
221show it
222********************************************************************************/
223function menuInit(){
224oMenu=new makeMenu('divMenu')
225scrolled=n?"window.pageYOffset":"document.body.scrollTop"
226oMenu.css.left=-oMenu.width+lshow
227ltop=(n)?oMenu.css.top:oMenu.css.pixelTop;
228oMenu.css.visibility='visible'
229if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
230}
231
232//Initing menu on pageload
233onload=menuInit;
234</script>
235</head>
236<body bgcolor="#FFFFFF" text="#000000">
237<div id="divMenu" style="position:absolute; top:250; left:30; width:200;</body></a></nobr></div></body></html>