<html> <head> <title>照片墙效果</title> <script type="text/javascript" src="js/jquery.js"></script> <link rel="stylesheet" href="js/animate.min.css" type="text/css"> </head> <body> <img src="qq.png" class="bounceIn"/> <img src="qq.png" > <img src="qq.png" > <img src="qq.png" > <img src="qq.png" > </body> <script> var arr=['bounce','flash','pulse','rubberBand','shakeswing','tadaw','obble','bounceInLeft','bounceInRight','bounceInUp'] $('img').on('click',function() { $('img').removeClass(); //随机生成新的class var rand=parseInt(Math.random()*10) $(this).addClass('animated '+arr[rand]) }) </script> </html>