返回事件绑定 照......登陆

事件绑定 照片墙

红色熊猫2019-05-08 14:54:16226

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<meta http-equiv="X-UA-Compatible" content="ie=edge" />

<link rel="stylesheet" type="text/css" href="Animate.css/animate.min.css"/>

<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>

<title>作业</title>

<style type="text/css">

#body{margin-top: 100px;}

#body img{width:150px;height: 150px;}

</style>

<script type="text/javascript">

$(function(){

var arr=['bounce','flash','pulse','rubberBand','shake','swing','tada','bounceOut','bounceOutDown','bounceOutLeft','bounceOutRight','bounceOutUp','fadeIn','fadeInDown','fadeInDownBig','fadeInLeft','fadeInLeftBig','fadeInRight','fadeInRightBig','fadeInUp','fadeInUpBig'];


$('#body img').on('click',function(){

$('img').removeClass();//清楚所有的图片claa类防止部分没有恢复

var l=parseInt(Math.random()*(arr.length));

var rad=arr[l];

$(this).addClass('animated '+rad);

})

})


</script>

</head>

<body>

 

<div id="body">

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

<img src="img/a.png" alt="" />

</div>

</body>

</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送