- <!DOCTYPE html>
- <HTML>
- <head>
- <meta charset="UTF-8">
- <title>
- Insert title here
- </title>
- <script type="text/javascript" src="https://cdn.bootCSS.com/jquery/3.2.1/jquery.js">
- </script>
- </head>
- <body style="width:100%;height:100%;position:absolute;">
- </body>
- <script type="text/javascript">
- var a_idx = 0;
- $(document).ready(function($) {
- $("body").click(function(e) {
- var a = new Array("<img src='image / 心碎. svg'style='width:400px;height:400px;'>", "<img src='image / 心. svg'style='width:20px;height:20px;'>", "<img src='image / 心型. svg'style='width:15px;height:15px;'>", "<img src='image/ic_xin.svg'style='width:15px;height:15px;'>");
- var $i = $("<span/>").HTML(a[a_idx]);
- a_idx = (a_idx + 1) % a.length;
- var x = e.pageX,
- y = e.pageY;
- $i.CSS({
- "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
- "top": y - 20,
- "left": x,
- "position": "absolute",
- "font-weight": "bold",
- "color": "#ff6651"
- });
- $("body").append($i);
- $i.animate({
- "top": y - 180,
- "opacity": 0
- },
- 1500,
- function() {
- $i.remove();
- });
- });
- });
- </script>
- </HTML>
来源: http://www.bubuko.com/infodetail-3218506.html