69、左键的点击来导出隐藏层

69、左键的点击来导出隐藏层

脚本说明:

第一步:把如下代码加入<body>区域中

<STYLE>#slidemenubar {

       BACKGROUND-COLOR:#FF0000;BORDER-BOTTOM: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid;  FONT: bold 12px/20px Verdana; LEFT: -155px; POSITION: absolute; TOP: 10px; WIDTH: 200px; layer-background-color: #FFff00

}

#slidemenubar2 {

       BACKGROUND-COLOR: #FF0000; BORDER-BOTTOM: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid;  FONT: bold 12px/20px Verdana; LEFT: -155px; POSITION: absolute; TOP: 10px; WIDTH: 200px; layer-background-color: #FFff00

}

.word {  font-size: 9pt; line-height: 13pt; color: #ffccdd}

.word1 {  font-size: 8pt; line-height: 13pt; color: #ffccdd}

</STYLE>

 

<font class="word"></font>

<p><font color="#CCCCCC"></font>

  <!-- ************************************************************** -->

</p>

<div id="Layer2" style="position:absolute; left:439px; top:58px; width:227px; height:7px; z-index:2" class="word">

  <font color="#FF0000">请在网页任何地方点击鼠标左键弹出作品菜单,点击鼠标右键让作品菜单消失,X键和Z键也可以。</font></div>

<script LANGUAGE="JavaScript">

window.moveTo(0,screen.availwidth)

var b=screen.availwidth

var count=2;

var a=0

setInterval("go()", 1);

function go(u)

{

count+=1

b=b-1.7*count

if(b<0)

b=0

window.moveTo(b,a)

if(b<=0)

window.moveTo(0,0)

}

function showtip(nulling){

if (document.all){

if (nulling==0&&slidemenubar2.style.pixelLeft==-250)

slidemenubar2.title='Press "x" to expand the menu, "z" to contract it'

else

slidemenubar2.title=''

}

else if (document.layers){

if (nulling==0&&!window.pullit)

window.status='Press "x" to expand the menu, "z" to contract it'

else

window.status=''

}

}

if (document.all)

document.write('<div id="slidemenubar2" style="left:-250" onMouseover="showtip(0)" onMouseout="showtip(1)">')

</SCRIPT>

<LAYER id=slidemenubar onmouseout=showtip(1) onmouseover=showtip(0) left="0">

<div align="center">

  <SCRIPT language=JavaScript1.2 class="word1">

var sitems=new Array()

var sitemlinks=new Array()

sitems[0]="<table width=189 border=0 cellspacing=0 cellpadding=0 height=21 class=word1>"

sitems[1]="<tr>"

sitems[2]="<td>"

sitems[3]="<div align=left>"

sitems[4]="<p align=center><br>"

sitems[5]="请在网页任何地方点击鼠标左键弹出作品菜单,点击鼠标右键让作品菜单消失,X键和Z键也可以。<br>"

sitems[6]="暂时分出这两个类,以后看情况添加改变。</p>"

sitems[7]="<p align=center><br>"

sitems[8]="设计作品<br>"

sitems[9]="<br>"

sitems[10]="文学作品<br>"

sitems[11]="<br>"

sitems[12]="</p>"

sitems[13]="</div>"

sitems[14]="</td>"

sitems[15]="</tr>"

sitems[16]="</table>"

sitems[17]="<table width=100% border=0 cellspacing=0 cellpadding=0>"

sitems[18]="<tr>"

sitems[19]="<td>"

sitems[20]="<div align=center>"

sitems[21]="</div>"

sitems[22]="</td>"

sitems[23]="</tr>"

sitems[24]="</table>"

for(i=0;i<25;i++)

document.write(sitems[i])

 

</SCRIPT>

</div>

<p class="word"> </p>

</LAYER>

<p>

  <SCRIPT language=JavaScript1.2>

 

function regenerate(){

window.location.reload()

}

function regenerate2(){

if (document.layers)

setTimeout("window.onresize=regenerate",400)

}

window.onload=regenerate2

if (document.all){

document.write('</div>')

themenu=document.all.slidemenubar2.style

rightboundary=0

leftboundary=-250

}

else{

themenu=document.layers.slidemenubar

rightboundary=250

leftboundary=0

}

function pull(){

if (window.drawit)

clearInterval(drawit)

pullit=setInterval("pullengine()",50)

}

function draw(){

pullit=""

clearInterval(pullit)

drawit=setInterval("drawengine()",50)

}

function pullengine(){

if (document.all&&themenu.pixelLeft<rightboundary)

themenu.pixelLeft+=15

else if(document.layers&&themenu.left<rightboundary)

themenu.left+=15

else if (window.pullit)

clearInterval(pullit)

}

function drawengine(){

if (document.all&&themenu.pixelLeft>leftboundary)

themenu.pixelLeft-=15

else if(document.layers&&themenu.left>leftboundary)

themenu.left-=15

else if (window.drawit)

clearInterval(drawit)

}

 

if (document.layers)

document.captureEvents(Event.KEYPRESS)

function menuengine(e){

if (document.layers){

if (e.which==120)

pull()

if (e.which==122)

draw()

}

else if (document.all){

if (event.keyCode==120)

pull()

if (event.keyCode==122)

draw()

}

}

document.onkeypress=menuengine

function click() {

if (event.button==1) {

pull()

}else{

draw()

}

}

document.onmousedown=click

</script>

 

第二步:把<body>中的代码改为:

<body   oncontextmenu=self.event.returnValue=false>

Write a comment

Comments: 0