CSS3 like plus one animation special effects
<script type="text/javascript"> (function ($) { $.extend({ tipsBox: function (options) { options = $.extend({ obj: null, //jq对象,要在那个html标签上显示 str: "+1", //字符串,要显示的内容;也可以传一段html,如: "<b style='font-family:Microsoft YaHei;'>+1</b>" startSize: "12px", //动画开始的文字大小 endSize: "30px", //动画结束的文字大小 interval: 600, //动画时间间隔 color: "red", //文字颜色 callback: function () { } //回调函数 }, options); $("body").append("<span class='num'>" + options.str + "</span>"); var box = $(".num"); var left = options.obj.offset().left + options.obj.width() / 2; var top = options.obj.offset().top - options.obj.height(); box.css({ "position": "absolute", "left": left + "px", "top": top + "px", "z-index": 9999, "font-size": options.startSize, "line-height": options.endSize, "color": options.color }); box.animate({ "font-size": options.endSize, "opacity": "0", "top": top - parseInt(options.endSize) + "px" }, options.interval, function () { box.remove(); options.callback(); }); } }); })(jQuery); function niceIn(prop){ prop.find('i').addClass('niceIn'); setTimeout(function(){ prop.find('i').removeClass('niceIn'); },1000); } $(function () { $("#btn").click(function () { $.tipsBox({ obj: $(this), str: "+1", callback: function () { } }); niceIn($(this)); }); }); </script>
这是一款基于jQuery+CSS3实现的比较实用点赞加一动画特效,jQuery点赞按钮动画效果。
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
24 Jun 2016
Based on css3 cool page loading animation special effects code
24 Jun 2016
Animation loading special effects implemented in pure css3
24 Jun 2016
A batch of hover special effects implemented by CSS3
![CSS3 mouse slides over animated line border special effects](http://hovertree.com/hvtimg/bjafjg/dc6vc0fh.png)
06 Jul 2016
CSS3 mouse slides over animated line border special effects
24 Jun 2016
CSS3 elastic stacking image switching special effects suitable for mobile
24 Jun 2016
Based on jQ CSS3 page scrolling content element animation special effects
24 Jun 2016
CSS3 mobile side sliding menu 4 kinds of sliding menu special effects
24 Jun 2016
CSS3 practical development: Baidu news hot search word special effects practical development
24 Jun 2016
9 types of cool CSS3 images with expanded previews and animated special effects
![See all articles](/static/imghw/down_right.png)
![](/static/imghw/taglogo.png)
Hot Tools
![CSS text is combined into a heart-shaped animation special effect](https://img.php.cn/upload/jscode/000/000/001/5a41aee69fa64854.png)
CSS text is combined into a heart-shaped animation special effect
CSS text is combined into a heart-shaped animation special effect
![CSS3 SVG expression flower animation special effects](https://img.php.cn/upload/jscode/000/000/001/58d8cebcc2691208.jpg)
CSS3 SVG expression flower animation special effects
SS3 SVG confession flower animation special effect is a Valentine's Day animation special effect.
![CSS shopping mall websites commonly use left category drop-down navigation menu code](https://img.php.cn/upload/jscode/000/000/001/5a3db819dcdbc612.png)
CSS shopping mall websites commonly use left category drop-down navigation menu code
CSS shopping mall websites commonly use left category drop-down navigation menu code
![jQuery+CSS3 Valentine's Day love special effects](https://img.php.cn/upload/jscode/000/000/001/58d8d3ea886c2698.jpg)
jQuery+CSS3 Valentine's Day love special effects
jQuery+CSS3 Valentine's Day Love Special Effect is a Valentine's Day hanging swinging heart animation special effect.
![css3 spoon scooping up glutinous rice balls animation special effects](https://img.php.cn/upload/jscode/000/287/557/6209ad3adc2fc558.png)
css3 spoon scooping up glutinous rice balls animation special effects
A bowl of cute glutinous rice balls expression, a spoon scooping up a glutinous rice balls animation special effects
![](/static/imghw/taglogo.png)