html js 禁用鼠标双击,JS控制鼠标拒绝点击某一按钮的实例

Document

window.οnlοad=function(){

document.getElementById("s").οnmοuseοver=function(evet){

var _x=this.offsetLeft;

var _y=this.offsetTop;

var x=Math.random()*180+Math.random()*50;

var y=Math.random()*120+Math.random()*50;

this.style.position="absolute";

this.style.top=y+'px';

this.style.left=x+'px';

return false;

}

document.getElementById("s").οnclick=function(){

alert("就知道你心里想的和表面做的是相反的!");

document.getElementById("main").style.display="none";

document.getElementById("img").style.display="block";

}

document.getElementById("w").οnclick=function(){

alert("宝贝:谢谢你的爱!我爱你╮(╯▽╰)╭");

document.getElementById("main").style.display="none";

document.getElementById("img").style.display="block";

}

}

*{

margin:0;

padding:0;

}

html{

height: 100%;

background:url(http://img17.3lian.com/d/file/201702/13/9524e4e08e99e0423f9e9f299e314c72.gif) no-repeat;

background-size: cover;

}

span{

width: 100%;

height: 100px;

display: block;

text-align: center;

line-height: 100px;

color: #fff;

}

section{

}

section button:nth-child(1){

position: absolute;

background: #DE7C2C;

left: 100px;

border: 0;

z-index: 1;

}

section button:nth-child(2){

position: absolute;

z-index: 0;

border: 0;

background: #DE7C2C;

left: 150px;

}

div{

width:300px;

height:200px;

background:rgba(34,93,146,.7);

border:1px solid #eee;

position:absolute;

left:0;

top: 0;

bottom: 0;

right: 0;

margin: auto;

}

亲爱的我爱你,你爱我吗?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值