<html>
<head>
<title>leftright</title>
<script language=javascript>
<!--
function showmessage(){
var right=document.body.clientWidth-180;
var buttom=document.body.clientHeight-60;
pic1.left=pic_x;
pic1.top=pic_y;
if(lock_x==1){
pic_x+=1;
}else if(lock_x==2){
pic_x-=1;
}
if(lock_y==1){
pic_y+=1;
}else if(lock_y==2){
pic_y-=1;
}
if(pic_x<0){
lock_x=1;
}else if(pic_x>right){
lock_x=2;
}
if(pic_y<0){
lock_y=1;
}else if(pic_y>buttom){
lock_y=2;
}
}
function go(){
action=window.setInterval(showmessage,10);
}
-->
</script>
</head>
<body onLoad="go()">
<div id="Lay" style="position:absolute; left:0; top:0; width:180; height:60; z-index:1"><a href="http://www.qhschool.com" target="_blank" ><img src="0002_GIF.gif" width="180" height="60" border="0"></a></div>
<script language="javascript">
var pic1=eval('document.all.Lay.style');
var pic_x=0;
var pic_y=0;
var lock_x=1;
var lock_y=1;
var action=0;
</script>
</body>
</html>
//下面两个是用于中止广告的代码,一个是鼠标的,一个是键盘的
function vis_false(){
if(event.button==1){
pic1.display="none";
window.clearInterval(action);
}else if(event.button==2){
pic1.display="inline";
go();
}
}
使用的时候<body onLoad="go()" OnMouseDown="vis_false()">
function vis_false(){
if(event.keyCode==65){//字母a
pic1.display="none";
window.clearInterval(action);
}else if(event.keyCode==66){//字母b
pic1.display="inline";
go();
}
OnKeyDown="vis_false()"//当然这里也要改!
very good,,非常好用!