把js代码直接加入footer.php中即可。
点击鼠标,红色随机数字上升特效代码
-
-
-
-
- <script>
- jQuery(document).ready(function($) {
- var _click_count=0;
- $("body").bind("click",function(e){
- var n=Math.round(Math.random()*100);
-
- var $i=$("<b>").text("+"+(++n));
- var x=e.pageX,y=e.pageY;
- $i.css({
- "z-index":99999,
- "top":y-15,
- "left":x,
- "position":"absolute",
- "color":"red"
- });
- $("body").append($i);
- $i.animate(
- {"top":y-180,"opacity":0},
- 1500,
- function(){$i.remove();}
- );
- e.stopPropagation();
- });
- });
- </script>
点击鼠标,红色标语上升特效代码
-
-
-
-
- <script type="text/javascript">
- var a_idx = 0;
- jQuery(document).ready(function($) {
- $("body").click(function(e) {
- var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正" ,"法治", "爱国", "敬业", "诚信", "友善");
- var $i = $("<span/>").text(a[a_idx]);
- a_idx = (a_idx + 1) % a.length;
- var x = e.pageX,
- y = e.pageY;
- $i.css({
- "z-index": 9999999999999999999999999999999999999999,
- "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>
点赞
https://wosn.net/301.html
复制链接
- 本文由 沃森博客 发表于 2017年9月5日17:11:03
- 本文来自互利网收集整理,问题反馈联系邮箱:wosnnet@foxmail.com,转载请务必保留本文链接:https://wosn.net/301.html
//禁止复制
评论