有趣js记录不定时更新

[].forEach.call(document.querySelectorAll(""),function(a){a.style.outline=“1px solid #”+(~~(Math.random()(1<<24))).toString(16)}
//此段js实现了给页面所有元素都加一个随机颜色的边框

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var DI= document.getElementsByTagName(“img”); DIL=DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position=‘absolute’; DIS.left=Math.sin(Rx1+ix2+x3)x4+x5+“px”; DIS.top=Math.cos(Ry1+i*y2+y3)*y4+y5+“px”}R++}tag=setInterval(‘A()’,5 );document.οnmοusedοwn=function(){clearInterval(tag);for(i=0; i<DIL; i++){DI[i].style.position=“static”;}}; void(0)
//此段代码可以让网页里的图片飞起来

把网页变成可编辑模式

javascript:document.body.contentEditable='true'; document.designMode='on'; void(0);

必须点yes

<html>
<head>
<title>You must love me</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="copyright" content="http://www.javascriptbank.com" />
<script type="text/javascript"> flag=1 function f1() { alert("Yes. you are right ") } function f() { if(flag==1) { Bn.style.top=90 Bn.style.left=500 flag=2 } else if(flag==2) { Bn.style.top=90 Bn.style.left=50 flag=3 } else if(flag==3) { Bn.style.top=235 Bn.style.left=360 flag=1 } } </script>
</head>
<body>
<h1 style="position:absolute; left:220px; top:175px; width:auto; height:210px;">Do you love me?</h1>
<div id="By" style="position:absolute; left:285px; top:235px; width:210px; height:210px;">
	<input type="button" value=" yes " onclick="f1undefined)" />
</div>
<div id="Bn" style="position:absolute; left:360px; top:235px; width:210px; height:210px;">
	<input type="button" value=" no " onmouseover="fundefined)" />
</div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值