首页 > 代码库 > python:点赞功能
python:点赞功能
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta charset="UTF-8"> <title>Title</title> <style> .container { padding: 50px; border: 1px solid #dddddd; } .item { position: relative; width: 30px; } </style> </head> <body> <div class="container"> <div class="item"> <span>赞</span> </div> </div> <div class="container"> <div class="item"> <span>赞</span> </div> </div> <div class="container"> <div class="item"> <span>赞</span> </div> </div> <div class="container"> <div class="item"> <span>赞</span> </div> </div> <script src="jquery-1.12.4.js"></script> <script> $(‘.item‘).click(function () { adFavor(this); }); function adFavor(self) { // var t=$(self) // console.log(t) var fontSize = 15; var top = 0; var right = 0; var opacity = 1; var tag = document.createElement(‘span‘); $(tag).text(‘+1‘); $(tag).css(‘color‘, ‘green‘); $(tag).css(‘fontSize‘, fontSize + ‘px‘); $(tag).css(‘position‘, ‘absolute‘); $(tag).css(‘top‘, top + ‘px‘); $(tag).css(‘right‘, right + ‘px‘); $(tag).css(‘opacity‘, opacity) $(self).append(tag) var v = setInterval(function () { fontSize = fontSize + 5; top = top - 5; right = right - 5; opacity = opacity - 0.2; $(tag).css(‘fontSize‘, fontSize + ‘px‘); $(tag).css(‘top‘, top + ‘px‘); $(tag).css(‘right‘, right + ‘px‘); $(tag).css(‘opacity‘, opacity); // console.log(opacity) if (opacity < 0) { clearInterval(v); $(tag).remove(); // 移除这个标签 // <span style="color: green; position: absolute; font-size: 45px; right: -30px; top: -30px; opacity: -0.2;">+1</span> } }, 40); } </script> </body> </html>
python:点赞功能
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。