鼠标点击本站任何页面会依次显示习大大的24 字方针,效果可见本站!
实现这样的效果并不难,在 view/htm/footer.inc.htm (如果安装了覆盖此文件的插件,则需要在插件里修改)里加入一小段JS代码即可:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<script> ( function () { var coreSocialistValues = [ "富强" , "民主" , "文明" , "和谐" , "自由" , "平等" , "公正" , "法治" , "爱国" , "敬业" , "诚信" , "友善" ], index = Math.floor(Math.random() * coreSocialistValues.length); document.body.addEventListener( 'click' , function (e) { if (e.target.tagName == 'A' ) { return ; } var x = e.pageX, y = e.pageY, span = document.createElement( 'span' ); span.textContent = coreSocialistValues[index]; index = (index + 1) % coreSocialistValues.length; span.style.cssText = [ 'z-index: 9999999; position: absolute; font-weight: bold; color: #ff6651; top: ' , y - 20, 'px; left: ' , x, 'px;' ].join( '' ); document.body.appendChild(span); animate(span); }); function animate(el) { var i = 0, top = parseInt(el.style.top), id = setInterval(frame, 16.7); function frame() { if (i > 180) { clearInterval(id); el.parentNode.removeChild(el); } else { i += 2; el.style.top = top - i + 'px' ; el.style.opacity = (180 - i) / 180; } } } } ()); </script> |
内容看完了
© 版权声明
请登录后发表评论
注册