结合 Akina & Siren 修改自用 – WeiPress

发布于 2019-05-12  59 次阅读


好记性不如烂笔头…

文章图像

图片存放所在位置:\images\random
分别修改 tpl 目录下的 content.php 和 content-image.php 文件中的如下代码:

<a href="<?php the_permalink();?>"><div class="overlay"><i class="iconfont"></i></div><img src="<?php bloginfo('template_url'); ?>/images/random/<?php echo sprintf('%02d',rand(1,14))?>.jpg" /></a>

特色图片

鼠标点击

鼠标点击事件,代码如下,新建一个 JS 文件进行引用:

<script type="text/javascript">var a_idx=0;jQuery(document).ready(function($){$("body").click(function(e){var a=new Array("富强","民主","文明","和谐","自由","平等","公正","法治","爱国","敬业","诚信","友善");var $i=$("<span></span>").text(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>

二十多岁的年纪,希冀着时光别走…